Table
entry_scan
Every entrance scan; only the first of the day records how the visitor travelled.
Replaces in 2020: Entrance, Ticket.Transportation
Rows 7,001–7,025 of 9,738
| scan_idINTEGER | ticket_id→ ticket.ticket_id | entrance_id→ entrance.entrance_id | scanned_atTEXT | is_first_entryINTEGER | transport_modeTEXT |
|---|---|---|---|---|---|
| 7001 | 6806 | 1 | 2018-12-09 12:37:59 | 1 | Bus |
| 7002 | 6811 | 1 | 2018-12-09 12:38:15 | 1 | Bus |
| 7003 | 6812 | 1 | 2018-12-09 12:38:23 | 1 | Bus |
| 7004 | 6814 | 1 | 2018-12-09 12:38:39 | 1 | Bus |
| 7005 | 6817 | 1 | 2018-12-09 12:38:40 | 1 | Bus |
| 7006 | 6807 | 1 | 2018-12-09 12:39:01 | 1 | Bus |
| 7007 | 6816 | 1 | 2018-12-09 12:39:17 | 1 | Bus |
| 7008 | 6819 | 1 | 2018-12-09 12:39:19 | 1 | Bus |
| 7009 | 6826 | 1 | 2018-12-09 12:40:07 | 1 | Bus |
| 7010 | 6828 | 1 | 2018-12-09 12:40:56 | 1 | Bus |
| 7011 | 6820 | 1 | 2018-12-09 12:41:11 | 1 | Bus |
| 7012 | 6825 | 1 | 2018-12-09 12:41:29 | 1 | Bus |
| 7013 | 6823 | 1 | 2018-12-09 12:41:35 | 1 | Bus |
| 7014 | 6821 | 1 | 2018-12-09 12:41:50 | 1 | Bus |
| 7015 | 6818 | 1 | 2018-12-09 12:41:59 | 1 | Bus |
| 7016 | 6827 | 1 | 2018-12-09 12:43:59 | 1 | Bus |
| 7017 | 7224 | 3 | 2018-12-11 09:18:28 | 1 | Walk |
| 7018 | 7252 | 2 | 2018-12-11 09:42:17 | 1 | Metro |
| 7019 | 7210 | 1 | 2018-12-11 13:44:09 | 1 | Walk |
| 7020 | 7211 | 1 | 2018-12-11 13:44:33 | 1 | Walk |
| 7021 | 7257 | 4 | 2018-12-12 10:28:23 | 1 | Metro |
| 7022 | 7256 | 4 | 2018-12-12 10:28:54 | 1 | Metro |
| 7023 | 7259 | 1 | 2018-12-12 12:01:07 | 1 | Metro |
| 7024 | 7258 | 1 | 2018-12-12 12:01:25 | 1 | Metro |
| 7025 | 7228 | 1 | 2018-12-13 12:30:20 | 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;