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,251–8,275 of 9,738
| scan_idINTEGER | ticket_id→ ticket.ticket_id | entrance_id→ entrance.entrance_id | scanned_atTEXT | is_first_entryINTEGER | transport_modeTEXT |
|---|---|---|---|---|---|
| 8251 | 8412 | 2 | 2019-06-25 10:12:19 | 1 | Train |
| 8252 | 8414 | 2 | 2019-06-25 10:12:19 | 1 | Train |
| 8253 | 8415 | 2 | 2019-06-25 10:12:20 | 1 | Train |
| 8254 | 8413 | 2 | 2019-06-25 10:12:55 | 1 | Train |
| 8255 | 8283 | 4 | 2019-06-25 10:56:16 | 1 | Bus |
| 8256 | 8431 | 2 | 2019-06-25 10:59:36 | 1 | Metro |
| 8257 | 8432 | 2 | 2019-06-25 10:59:58 | 1 | Metro |
| 8258 | 8430 | 2 | 2019-06-25 11:00:08 | 1 | Metro |
| 8259 | 8435 | 1 | 2019-06-26 14:36:11 | 1 | Walk |
| 8260 | 8425 | 1 | 2019-06-27 11:46:34 | 1 | Walk |
| 8261 | 8423 | 1 | 2019-06-27 11:47:05 | 1 | Walk |
| 8262 | 8424 | 1 | 2019-06-27 11:47:05 | 1 | Walk |
| 8263 | 8426 | 1 | 2019-06-27 11:47:11 | 1 | Walk |
| 8264 | 8440 | 4 | 2019-06-27 14:19:06 | 1 | Metro |
| 8265 | 8439 | 4 | 2019-06-27 14:19:22 | 1 | Metro |
| 8266 | 8441 | 4 | 2019-06-27 14:19:25 | 1 | Metro |
| 8267 | 8438 | 4 | 2019-06-27 14:19:36 | 1 | Metro |
| 8268 | 8421 | 5 | 2019-06-28 10:31:38 | 1 | Private Vehicle |
| 8269 | 8422 | 5 | 2019-06-28 10:31:43 | 1 | Private Vehicle |
| 8270 | 8442 | 1 | 2019-06-28 13:01:42 | 1 | Walk |
| 8271 | 8443 | 1 | 2019-06-28 13:02:03 | 1 | Walk |
| 8272 | 8427 | 1 | 2019-06-28 14:11:23 | 1 | Metro |
| 8273 | 8428 | 1 | 2019-06-28 14:11:54 | 1 | Metro |
| 8274 | 8450 | 1 | 2019-06-29 09:56:14 | 1 | Taxi |
| 8275 | 8448 | 1 | 2019-06-29 09:56:36 | 1 | Taxi |
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;