Table
entry_scan
Every entrance scan; only the first of the day records how the visitor travelled.
Replaces in 2020: Entrance, Ticket.Transportation
Rows 6,876–6,900 of 9,738
| scan_idINTEGER | ticket_id→ ticket.ticket_id | entrance_id→ entrance.entrance_id | scanned_atTEXT | is_first_entryINTEGER | transport_modeTEXT |
|---|---|---|---|---|---|
| 6876 | 7203 | 1 | 2018-11-28 10:48:36 | 1 | Metro |
| 6877 | 7168 | 1 | 2018-11-28 14:00:48 | 1 | Other |
| 6878 | 7167 | 1 | 2018-11-28 14:00:56 | 1 | Other |
| 6879 | 7199 | 1 | 2018-11-29 10:08:36 | 1 | Walk |
| 6880 | 7201 | 1 | 2018-11-29 10:09:06 | 1 | Walk |
| 6881 | 7200 | 1 | 2018-11-29 10:09:11 | 1 | Walk |
| 6882 | 7169 | 1 | 2018-11-29 11:56:21 | 1 | Walk |
| 6883 | 7209 | 1 | 2018-11-30 09:18:28 | 1 | Bus |
| 6884 | 7208 | 1 | 2018-11-30 09:19:08 | 1 | Bus |
| 6885 | 7212 | 5 | 2018-11-30 12:41:56 | 1 | Walk |
| 6886 | 7213 | 5 | 2018-11-30 12:42:04 | 1 | Walk |
| 6887 | 7178 | 2 | 2018-11-30 13:10:28 | 1 | Walk |
| 6888 | 7179 | 2 | 2018-11-30 13:10:28 | 1 | Walk |
| 6889 | 7015 | 1 | 2018-12-01 10:15:29 | 1 | Other |
| 6890 | 7016 | 1 | 2018-12-01 10:15:36 | 1 | Other |
| 6891 | 7014 | 1 | 2018-12-01 10:15:52 | 1 | Other |
| 6892 | 7197 | 5 | 2018-12-01 11:03:10 | 1 | Private Vehicle |
| 6893 | 7196 | 5 | 2018-12-01 11:03:16 | 1 | Private Vehicle |
| 6894 | 7197 | 1 | 2018-12-01 13:44:41 | 0 | NULL |
| 6895 | 7196 | 5 | 2018-12-01 14:31:13 | 0 | NULL |
| 6896 | 7188 | 1 | 2018-12-02 09:15:48 | 1 | Metro |
| 6897 | 7186 | 1 | 2018-12-02 09:16:02 | 1 | Metro |
| 6898 | 7185 | 1 | 2018-12-02 09:16:08 | 1 | Metro |
| 6899 | 7189 | 1 | 2018-12-02 09:16:10 | 1 | Metro |
| 6900 | 7187 | 1 | 2018-12-02 09:16:21 | 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;