Table
entry_scan
Every entrance scan; only the first of the day records how the visitor travelled.
Replaces in 2020: Entrance, Ticket.Transportation
Rows 3,451–3,475 of 9,738
| scan_idINTEGER | ticket_id→ ticket.ticket_id | entrance_id→ entrance.entrance_id | scanned_atTEXT | is_first_entryINTEGER | transport_modeTEXT |
|---|---|---|---|---|---|
| 3451 | 3615 | 5 | 2017-03-16 14:29:48 | 1 | Walk |
| 3452 | 3617 | 5 | 2017-03-16 14:30:01 | 1 | Walk |
| 3453 | 3630 | 2 | 2017-03-17 14:40:08 | 1 | Other |
| 3454 | 3515 | 2 | 2017-03-18 11:10:24 | 1 | Private Vehicle |
| 3455 | 3516 | 2 | 2017-03-18 11:10:24 | 1 | Private Vehicle |
| 3456 | 3514 | 2 | 2017-03-18 11:10:39 | 1 | Private Vehicle |
| 3457 | 3517 | 2 | 2017-03-18 11:10:52 | 1 | Private Vehicle |
| 3458 | 3631 | 1 | 2017-03-18 11:47:43 | 1 | Walk |
| 3459 | 3557 | 2 | 2017-03-18 12:19:49 | 1 | Bus |
| 3460 | 3628 | 1 | 2017-03-20 11:13:38 | 1 | Bus |
| 3461 | 3627 | 1 | 2017-03-20 11:13:39 | 1 | Bus |
| 3462 | 3626 | 1 | 2017-03-20 11:13:47 | 1 | Bus |
| 3463 | 3629 | 2 | 2017-03-20 11:15:57 | 1 | Other |
| 3464 | 3594 | 1 | 2017-03-20 15:59:48 | 1 | Walk |
| 3465 | 3684 | 2 | 2017-03-21 11:00:45 | 1 | Other |
| 3466 | 3683 | 2 | 2017-03-21 11:00:47 | 1 | Other |
| 3467 | 3690 | 2 | 2017-03-23 14:21:12 | 1 | Metro |
| 3468 | 3692 | 3 | 2017-03-25 10:20:39 | 1 | Taxi |
| 3469 | 3624 | 1 | 2017-03-25 11:07:13 | 1 | Bus |
| 3470 | 3625 | 1 | 2017-03-25 11:07:53 | 1 | Bus |
| 3471 | 3562 | 1 | 2017-03-25 11:49:34 | 1 | Walk |
| 3472 | 3561 | 1 | 2017-03-25 11:50:11 | 1 | Walk |
| 3473 | 3691 | 1 | 2017-03-25 13:01:53 | 1 | Taxi |
| 3474 | 3613 | 2 | 2017-03-25 14:53:43 | 1 | Metro |
| 3475 | 3614 | 2 | 2017-03-25 14:53:53 | 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;