Table
entry_scan
Every entrance scan; only the first of the day records how the visitor travelled.
Replaces in 2020: Entrance, Ticket.Transportation
Rows 8,051–8,075 of 9,738
| scan_idINTEGER | ticket_id→ ticket.ticket_id | entrance_id→ entrance.entrance_id | scanned_atTEXT | is_first_entryINTEGER | transport_modeTEXT |
|---|---|---|---|---|---|
| 8051 | 8259 | 1 | 2019-05-26 12:31:52 | 1 | Bus |
| 8052 | 8255 | 2 | 2019-05-26 14:56:17 | 1 | Metro |
| 8053 | 8257 | 2 | 2019-05-26 14:56:34 | 1 | Metro |
| 8054 | 8258 | 2 | 2019-05-26 14:56:39 | 1 | Metro |
| 8055 | 8256 | 2 | 2019-05-26 14:56:47 | 1 | Metro |
| 8056 | 8274 | 1 | 2019-05-27 10:06:37 | 1 | Metro |
| 8057 | 8273 | 1 | 2019-05-27 10:06:53 | 1 | Metro |
| 8058 | 8242 | 2 | 2019-05-27 14:00:42 | 1 | Private Vehicle |
| 8059 | 8243 | 2 | 2019-05-27 14:00:57 | 1 | Private Vehicle |
| 8060 | 8286 | 2 | 2019-05-28 10:32:46 | 1 | Metro |
| 8061 | 8287 | 2 | 2019-05-28 10:33:18 | 1 | Metro |
| 8062 | 8288 | 2 | 2019-05-28 10:33:19 | 1 | Metro |
| 8063 | 8293 | 1 | 2019-05-28 13:33:42 | 1 | Metro |
| 8064 | 8292 | 1 | 2019-05-28 13:34:01 | 1 | Metro |
| 8065 | 8294 | 1 | 2019-05-28 13:34:06 | 1 | Metro |
| 8066 | 8254 | 1 | 2019-05-28 14:35:06 | 1 | Train |
| 8067 | 8227 | 2 | 2019-05-28 15:00:15 | 1 | Train |
| 8068 | 8226 | 2 | 2019-05-28 15:00:32 | 1 | Train |
| 8069 | 8204 | 1 | 2019-05-28 16:33:19 | 1 | Walk |
| 8070 | 8203 | 1 | 2019-05-28 16:33:47 | 1 | Walk |
| 8071 | 8280 | 1 | 2019-05-30 09:01:56 | 1 | Metro |
| 8072 | 8281 | 1 | 2019-05-30 09:02:20 | 1 | Metro |
| 8073 | 8297 | 4 | 2019-05-30 09:49:32 | 1 | Walk |
| 8074 | 8282 | 3 | 2019-05-31 09:13:45 | 1 | Walk |
| 8075 | 8301 | 1 | 2019-05-31 10:45:54 | 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;