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,051–7,075 of 9,738
| scan_idINTEGER | ticket_id→ ticket.ticket_id | entrance_id→ entrance.entrance_id | scanned_atTEXT | is_first_entryINTEGER | transport_modeTEXT |
|---|---|---|---|---|---|
| 7051 | 7176 | 2 | 2018-12-18 14:10:57 | 1 | Walk |
| 7052 | 7177 | 2 | 2018-12-18 14:11:10 | 1 | Walk |
| 7053 | 7286 | 2 | 2018-12-19 09:12:31 | 1 | Private Vehicle |
| 7054 | 7285 | 2 | 2018-12-19 09:12:32 | 1 | Private Vehicle |
| 7055 | 7279 | 1 | 2018-12-19 12:34:23 | 1 | Taxi |
| 7056 | 7289 | 2 | 2018-12-19 14:08:12 | 1 | Private Vehicle |
| 7057 | 7291 | 1 | 2018-12-20 09:40:49 | 1 | Metro |
| 7058 | 7290 | 1 | 2018-12-20 09:41:02 | 1 | Metro |
| 7059 | 7280 | 3 | 2018-12-20 10:48:34 | 1 | Metro |
| 7060 | 7290 | 1 | 2018-12-20 12:12:57 | 0 | NULL |
| 7061 | 7291 | 5 | 2018-12-20 12:46:08 | 0 | NULL |
| 7062 | 7338 | 1 | 2018-12-22 10:17:36 | 1 | Bus |
| 7063 | 7335 | 1 | 2018-12-22 10:17:38 | 1 | Bus |
| 7064 | 7337 | 1 | 2018-12-22 10:17:42 | 1 | Bus |
| 7065 | 7339 | 1 | 2018-12-22 10:17:49 | 1 | Bus |
| 7066 | 7336 | 1 | 2018-12-22 10:17:56 | 1 | Bus |
| 7067 | 7240 | 2 | 2018-12-22 11:11:39 | 1 | Private Vehicle |
| 7068 | 7237 | 2 | 2018-12-22 11:11:41 | 1 | Private Vehicle |
| 7069 | 7238 | 2 | 2018-12-22 11:11:56 | 1 | Private Vehicle |
| 7070 | 7239 | 2 | 2018-12-22 11:12:15 | 1 | Private Vehicle |
| 7071 | 7342 | 1 | 2018-12-23 13:32:58 | 1 | Walk |
| 7072 | 7340 | 1 | 2018-12-23 13:33:10 | 1 | Walk |
| 7073 | 7341 | 1 | 2018-12-23 13:33:13 | 1 | Walk |
| 7074 | 7202 | 1 | 2018-12-23 13:36:19 | 1 | Walk |
| 7075 | 7284 | 3 | 2018-12-23 13:49:28 | 1 | Bus |
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;