Table
entry_scan
Every entrance scan; only the first of the day records how the visitor travelled.
Replaces in 2020: Entrance, Ticket.Transportation
Rows 9,351–9,375 of 9,738
| scan_idINTEGER | ticket_id→ ticket.ticket_id | entrance_id→ entrance.entrance_id | scanned_atTEXT | is_first_entryINTEGER | transport_modeTEXT |
|---|---|---|---|---|---|
| 9351 | 8989 | 4 | 2019-12-15 11:11:32 | 1 | Bus |
| 9352 | 8998 | 4 | 2019-12-15 11:12:11 | 1 | Bus |
| 9353 | 8990 | 4 | 2019-12-15 11:12:47 | 1 | Bus |
| 9354 | 8994 | 4 | 2019-12-15 11:13:12 | 1 | Bus |
| 9355 | 8992 | 4 | 2019-12-15 11:13:17 | 1 | Bus |
| 9356 | 8995 | 4 | 2019-12-15 11:13:26 | 1 | Bus |
| 9357 | 8993 | 4 | 2019-12-15 11:13:32 | 1 | Bus |
| 9358 | 9002 | 4 | 2019-12-15 11:13:38 | 1 | Bus |
| 9359 | 8996 | 4 | 2019-12-15 11:14:17 | 1 | Bus |
| 9360 | 9000 | 4 | 2019-12-15 11:15:17 | 1 | Bus |
| 9361 | 9005 | 4 | 2019-12-15 11:15:46 | 1 | Bus |
| 9362 | 9004 | 4 | 2019-12-15 11:16:17 | 1 | Bus |
| 9363 | 9008 | 4 | 2019-12-15 11:16:28 | 1 | Bus |
| 9364 | 9517 | 1 | 2019-12-15 11:53:13 | 1 | Other |
| 9365 | 9518 | 1 | 2019-12-15 11:53:24 | 1 | Other |
| 9366 | 9448 | 1 | 2019-12-15 15:10:46 | 1 | Metro |
| 9367 | 9548 | 1 | 2019-12-17 10:27:21 | 1 | Walk |
| 9368 | 9547 | 1 | 2019-12-17 10:27:25 | 1 | Walk |
| 9369 | 9507 | 5 | 2019-12-17 13:25:54 | 1 | Walk |
| 9370 | 9506 | 5 | 2019-12-17 13:25:56 | 1 | Walk |
| 9371 | 9565 | 1 | 2019-12-18 11:16:21 | 1 | Walk |
| 9372 | 9566 | 1 | 2019-12-18 11:16:31 | 1 | Walk |
| 9373 | 9536 | 2 | 2019-12-18 11:25:28 | 1 | Private Vehicle |
| 9374 | 9350 | 3 | 2019-12-18 11:30:27 | 1 | Metro |
| 9375 | 9351 | 3 | 2019-12-18 11:31:02 | 1 | Metro |
Table definition
CREATE TABLE entry_scan (
scan_id INTEGER PRIMARY KEY,
ticket_id INTEGER NOT NULL REFERENCES ticket (ticket_id),
entrance_id INTEGER NOT NULL REFERENCES entrance (entrance_id),
scanned_at TEXT NOT NULL,
is_first_entry INTEGER NOT NULL CHECK (is_first_entry IN (0, 1)),
transport_mode TEXT CHECK (transport_mode IN ('Walk', 'Metro', 'Train', 'Bus', 'Taxi', 'Private Vehicle', 'Other')),
CHECK ((is_first_entry = 1) = (transport_mode IS NOT NULL))
) STRICT;