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,551–3,575 of 9,738
| scan_idINTEGER | ticket_id→ ticket.ticket_id | entrance_id→ entrance.entrance_id | scanned_atTEXT | is_first_entryINTEGER | transport_modeTEXT |
|---|---|---|---|---|---|
| 3551 | 3732 | 2 | 2017-04-08 10:23:45 | 1 | Metro |
| 3552 | 3688 | 2 | 2017-04-08 16:57:02 | 1 | Metro |
| 3553 | 3687 | 2 | 2017-04-08 16:57:16 | 1 | Metro |
| 3554 | 3730 | 4 | 2017-04-09 11:32:57 | 1 | Bus |
| 3555 | 3741 | 2 | 2017-04-11 11:27:03 | 1 | Private Vehicle |
| 3556 | 3733 | 3 | 2017-04-12 11:25:48 | 1 | Private Vehicle |
| 3557 | 3743 | 5 | 2017-04-12 12:02:44 | 1 | Walk |
| 3558 | 3742 | 5 | 2017-04-12 12:02:48 | 1 | Walk |
| 3559 | 3745 | 5 | 2017-04-12 12:02:52 | 1 | Walk |
| 3560 | 3744 | 5 | 2017-04-12 12:03:09 | 1 | Walk |
| 3561 | 3746 | 5 | 2017-04-12 12:03:16 | 1 | Walk |
| 3562 | 3743 | 5 | 2017-04-12 13:42:52 | 0 | NULL |
| 3563 | 3742 | 5 | 2017-04-12 14:05:15 | 0 | NULL |
| 3564 | 3744 | 4 | 2017-04-12 14:33:44 | 0 | NULL |
| 3565 | 3746 | 5 | 2017-04-12 14:38:49 | 0 | NULL |
| 3566 | 3758 | 1 | 2017-04-12 14:45:09 | 1 | Taxi |
| 3567 | 3745 | 2 | 2017-04-12 15:25:04 | 0 | NULL |
| 3568 | 3723 | 1 | 2017-04-13 12:58:42 | 1 | Walk |
| 3569 | 3724 | 1 | 2017-04-13 12:58:44 | 1 | Walk |
| 3570 | 3765 | 2 | 2017-04-14 11:15:03 | 1 | Private Vehicle |
| 3571 | 3763 | 2 | 2017-04-14 11:15:09 | 1 | Private Vehicle |
| 3572 | 3764 | 2 | 2017-04-14 11:15:33 | 1 | Private Vehicle |
| 3573 | 3762 | 2 | 2017-04-14 11:15:44 | 1 | Private Vehicle |
| 3574 | 3750 | 1 | 2017-04-14 11:22:26 | 1 | Walk |
| 3575 | 3752 | 1 | 2017-04-14 11:22:35 | 1 | Walk |
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;