Table
entry_scan
Every entrance scan; only the first of the day records how the visitor travelled.
Replaces in 2020: Entrance, Ticket.Transportation
Rows 9,151–9,175 of 9,738
| scan_idINTEGER | ticket_id→ ticket.ticket_id | entrance_id→ entrance.entrance_id | scanned_atTEXT | is_first_entryINTEGER | transport_modeTEXT |
|---|---|---|---|---|---|
| 9151 | 9223 | 4 | 2019-11-09 11:39:40 | 1 | Bus |
| 9152 | 9361 | 2 | 2019-11-09 14:45:35 | 1 | Taxi |
| 9153 | 9359 | 2 | 2019-11-09 14:45:48 | 1 | Taxi |
| 9154 | 9360 | 2 | 2019-11-09 14:45:57 | 1 | Taxi |
| 9155 | 9383 | 3 | 2019-11-10 10:47:14 | 1 | Bus |
| 9156 | 9341 | 3 | 2019-11-10 10:53:31 | 1 | Bus |
| 9157 | 9340 | 3 | 2019-11-10 10:54:09 | 1 | Bus |
| 9158 | 9385 | 5 | 2019-11-11 09:25:57 | 1 | Bus |
| 9159 | 9387 | 5 | 2019-11-11 09:26:17 | 1 | Bus |
| 9160 | 9386 | 5 | 2019-11-11 09:26:20 | 1 | Bus |
| 9161 | 9392 | 4 | 2019-11-11 09:32:09 | 1 | Bus |
| 9162 | 9391 | 4 | 2019-11-11 09:32:16 | 1 | Bus |
| 9163 | 9390 | 4 | 2019-11-11 09:32:20 | 1 | Bus |
| 9164 | 9389 | 4 | 2019-11-11 09:32:31 | 1 | Bus |
| 9165 | 9388 | 4 | 2019-11-11 09:32:43 | 1 | Bus |
| 9166 | 9384 | 1 | 2019-11-11 09:42:56 | 1 | Train |
| 9167 | 9384 | 1 | 2019-11-11 12:33:55 | 0 | NULL |
| 9168 | 9396 | 3 | 2019-11-12 10:37:31 | 1 | Walk |
| 9169 | 9394 | 5 | 2019-11-13 10:05:21 | 1 | Private Vehicle |
| 9170 | 9393 | 5 | 2019-11-13 10:05:31 | 1 | Private Vehicle |
| 9171 | 9401 | 3 | 2019-11-13 11:50:25 | 1 | Metro |
| 9172 | 9402 | 3 | 2019-11-13 11:50:27 | 1 | Metro |
| 9173 | 9306 | 3 | 2019-11-13 14:53:18 | 1 | Walk |
| 9174 | 9395 | 1 | 2019-11-14 09:38:41 | 1 | Metro |
| 9175 | 9362 | 1 | 2019-11-14 10:39:22 | 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;