Table
entry_scan
Every entrance scan; only the first of the day records how the visitor travelled.
Replaces in 2020: Entrance, Ticket.Transportation
Rows 6,001–6,025 of 9,738
| scan_idINTEGER | ticket_id→ ticket.ticket_id | entrance_id→ entrance.entrance_id | scanned_atTEXT | is_first_entryINTEGER | transport_modeTEXT |
|---|---|---|---|---|---|
| 6001 | 6283 | 2 | 2018-07-25 10:40:04 | 1 | Metro |
| 6002 | 6285 | 1 | 2018-07-25 12:00:16 | 1 | Metro |
| 6003 | 6284 | 1 | 2018-07-25 12:00:52 | 1 | Metro |
| 6004 | 6281 | 3 | 2018-07-26 09:17:03 | 1 | Walk |
| 6005 | 6280 | 3 | 2018-07-26 09:17:52 | 1 | Walk |
| 6006 | 5959 | 2 | 2018-07-26 09:39:52 | 1 | Metro |
| 6007 | 6296 | 2 | 2018-07-27 10:09:04 | 1 | Metro |
| 6008 | 6297 | 2 | 2018-07-27 10:09:22 | 1 | Metro |
| 6009 | 6236 | 1 | 2018-07-27 12:01:41 | 1 | Metro |
| 6010 | 6298 | 2 | 2018-07-27 12:18:29 | 1 | Metro |
| 6011 | 6269 | 2 | 2018-07-27 14:22:58 | 1 | Private Vehicle |
| 6012 | 6268 | 2 | 2018-07-27 14:23:22 | 1 | Private Vehicle |
| 6013 | 6268 | 2 | 2018-07-27 16:47:31 | 0 | NULL |
| 6014 | 6269 | 2 | 2018-07-27 16:57:40 | 0 | NULL |
| 6015 | 6300 | 1 | 2018-07-28 09:15:23 | 1 | Taxi |
| 6016 | 6301 | 1 | 2018-07-28 09:15:25 | 1 | Taxi |
| 6017 | 6287 | 2 | 2018-07-28 09:25:40 | 1 | Metro |
| 6018 | 6288 | 2 | 2018-07-28 09:25:44 | 1 | Metro |
| 6019 | 6289 | 2 | 2018-07-28 09:25:52 | 1 | Metro |
| 6020 | 6290 | 2 | 2018-07-28 09:25:54 | 1 | Metro |
| 6021 | 6286 | 2 | 2018-07-28 09:26:04 | 1 | Metro |
| 6022 | 6291 | 5 | 2018-07-28 09:35:08 | 1 | Walk |
| 6023 | 6293 | 5 | 2018-07-28 09:35:28 | 1 | Walk |
| 6024 | 6292 | 5 | 2018-07-28 09:35:30 | 1 | Walk |
| 6025 | 6303 | 5 | 2018-07-28 13:18:43 | 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;