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,476–8,500 of 9,738
| scan_idINTEGER | ticket_id→ ticket.ticket_id | entrance_id→ entrance.entrance_id | scanned_atTEXT | is_first_entryINTEGER | transport_modeTEXT |
|---|---|---|---|---|---|
| 8476 | 8568 | 5 | 2019-07-27 10:14:17 | 1 | Walk |
| 8477 | 8567 | 5 | 2019-07-27 10:14:26 | 1 | Walk |
| 8478 | 8569 | 5 | 2019-07-27 10:14:35 | 1 | Walk |
| 8479 | 8633 | 1 | 2019-07-27 11:13:31 | 1 | Walk |
| 8480 | 8634 | 1 | 2019-07-27 11:13:53 | 1 | Walk |
| 8481 | 8646 | 4 | 2019-07-27 12:13:38 | 1 | Train |
| 8482 | 8645 | 4 | 2019-07-27 12:13:45 | 1 | Train |
| 8483 | 8647 | 4 | 2019-07-27 12:13:47 | 1 | Train |
| 8484 | 8648 | 2 | 2019-07-27 12:35:58 | 1 | Metro |
| 8485 | 8649 | 2 | 2019-07-27 12:36:22 | 1 | Metro |
| 8486 | 8651 | 2 | 2019-07-27 14:55:40 | 1 | Private Vehicle |
| 8487 | 8650 | 2 | 2019-07-27 14:55:41 | 1 | Private Vehicle |
| 8488 | 8524 | 1 | 2019-07-28 09:01:33 | 1 | Bus |
| 8489 | 8523 | 1 | 2019-07-28 09:01:42 | 1 | Bus |
| 8490 | 8525 | 1 | 2019-07-28 09:01:57 | 1 | Bus |
| 8491 | 8526 | 1 | 2019-07-28 09:02:12 | 1 | Bus |
| 8492 | 8654 | 5 | 2019-07-28 13:52:47 | 1 | Bus |
| 8493 | 8640 | 1 | 2019-07-29 13:47:44 | 1 | Walk |
| 8494 | 8664 | 4 | 2019-07-30 11:24:26 | 1 | Walk |
| 8495 | 8663 | 4 | 2019-07-30 11:24:27 | 1 | Walk |
| 8496 | 8534 | 1 | 2019-07-30 13:19:55 | 1 | Bus |
| 8497 | 8536 | 1 | 2019-07-30 13:20:00 | 1 | Bus |
| 8498 | 8538 | 1 | 2019-07-30 13:20:04 | 1 | Bus |
| 8499 | 8537 | 1 | 2019-07-30 13:20:12 | 1 | Bus |
| 8500 | 8535 | 1 | 2019-07-30 13:20:26 | 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;