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,126–7,150 of 9,738
| scan_idINTEGER | ticket_id→ ticket.ticket_id | entrance_id→ entrance.entrance_id | scanned_atTEXT | is_first_entryINTEGER | transport_modeTEXT |
|---|---|---|---|---|---|
| 7126 | 6679 | 1 | 2018-12-24 10:30:08 | 1 | Bus |
| 7127 | 6656 | 1 | 2018-12-24 10:30:10 | 1 | Bus |
| 7128 | 6676 | 1 | 2018-12-24 10:30:35 | 1 | Bus |
| 7129 | 6667 | 1 | 2018-12-24 10:30:38 | 1 | Bus |
| 7130 | 6661 | 1 | 2018-12-24 10:30:44 | 1 | Bus |
| 7131 | 6662 | 1 | 2018-12-24 10:30:57 | 1 | Bus |
| 7132 | 6658 | 1 | 2018-12-24 10:31:11 | 1 | Bus |
| 7133 | 6682 | 1 | 2018-12-24 10:31:29 | 1 | Bus |
| 7134 | 6674 | 1 | 2018-12-24 10:31:55 | 1 | Bus |
| 7135 | 6680 | 1 | 2018-12-24 10:32:06 | 1 | Bus |
| 7136 | 6677 | 1 | 2018-12-24 10:32:28 | 1 | Bus |
| 7137 | 6675 | 1 | 2018-12-24 10:32:56 | 1 | Bus |
| 7138 | 6683 | 1 | 2018-12-24 10:36:28 | 1 | Bus |
| 7139 | 7329 | 2 | 2018-12-24 11:14:33 | 1 | Metro |
| 7140 | 7333 | 5 | 2018-12-25 14:31:00 | 1 | Walk |
| 7141 | 7334 | 5 | 2018-12-25 14:31:25 | 1 | Walk |
| 7142 | 7332 | 5 | 2018-12-25 14:31:27 | 1 | Walk |
| 7143 | 7332 | 5 | 2018-12-25 17:09:00 | 0 | NULL |
| 7144 | 7333 | 2 | 2018-12-25 17:10:48 | 0 | NULL |
| 7145 | 7350 | 4 | 2018-12-26 10:36:17 | 1 | Walk |
| 7146 | 7348 | 4 | 2018-12-26 10:36:22 | 1 | Walk |
| 7147 | 7349 | 4 | 2018-12-26 10:36:31 | 1 | Walk |
| 7148 | 7351 | 4 | 2018-12-26 10:36:34 | 1 | Walk |
| 7149 | 7356 | 4 | 2018-12-26 13:22:30 | 1 | Metro |
| 7150 | 7357 | 4 | 2018-12-26 13:22:34 | 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;