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,076–7,100 of 9,738
| scan_idINTEGER | ticket_id→ ticket.ticket_id | entrance_id→ entrance.entrance_id | scanned_atTEXT | is_first_entryINTEGER | transport_modeTEXT |
|---|---|---|---|---|---|
| 7076 | 7343 | 1 | 2018-12-23 14:08:30 | 1 | Walk |
| 7077 | 6625 | 1 | 2018-12-24 10:22:56 | 1 | Bus |
| 7078 | 6626 | 1 | 2018-12-24 10:23:07 | 1 | Bus |
| 7079 | 6627 | 1 | 2018-12-24 10:23:18 | 1 | Bus |
| 7080 | 6630 | 1 | 2018-12-24 10:23:31 | 1 | Bus |
| 7081 | 6628 | 1 | 2018-12-24 10:23:32 | 1 | Bus |
| 7082 | 6633 | 1 | 2018-12-24 10:23:36 | 1 | Bus |
| 7083 | 6635 | 1 | 2018-12-24 10:23:36 | 1 | Bus |
| 7084 | 6629 | 1 | 2018-12-24 10:23:52 | 1 | Bus |
| 7085 | 6636 | 1 | 2018-12-24 10:24:02 | 1 | Bus |
| 7086 | 6637 | 1 | 2018-12-24 10:24:08 | 1 | Bus |
| 7087 | 6632 | 1 | 2018-12-24 10:24:13 | 1 | Bus |
| 7088 | 6631 | 1 | 2018-12-24 10:24:14 | 1 | Bus |
| 7089 | 6634 | 1 | 2018-12-24 10:24:17 | 1 | Bus |
| 7090 | 6647 | 1 | 2018-12-24 10:24:46 | 1 | Bus |
| 7091 | 6641 | 1 | 2018-12-24 10:24:48 | 1 | Bus |
| 7092 | 6644 | 1 | 2018-12-24 10:25:09 | 1 | Bus |
| 7093 | 6639 | 1 | 2018-12-24 10:25:16 | 1 | Bus |
| 7094 | 6660 | 1 | 2018-12-24 10:25:16 | 1 | Bus |
| 7095 | 6665 | 1 | 2018-12-24 10:25:36 | 1 | Bus |
| 7096 | 6643 | 1 | 2018-12-24 10:25:38 | 1 | Bus |
| 7097 | 6666 | 1 | 2018-12-24 10:25:40 | 1 | Bus |
| 7098 | 6645 | 1 | 2018-12-24 10:25:56 | 1 | Bus |
| 7099 | 6638 | 1 | 2018-12-24 10:25:58 | 1 | Bus |
| 7100 | 6672 | 1 | 2018-12-24 10:26:04 | 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;