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,876–8,900 of 9,738
| scan_idINTEGER | ticket_id→ ticket.ticket_id | entrance_id→ entrance.entrance_id | scanned_atTEXT | is_first_entryINTEGER | transport_modeTEXT |
|---|---|---|---|---|---|
| 8876 | 9088 | 3 | 2019-10-15 11:20:40 | 1 | Metro |
| 8877 | 9176 | 2 | 2019-10-15 12:01:02 | 1 | Metro |
| 8878 | 9172 | 3 | 2019-10-15 12:13:55 | 1 | Taxi |
| 8879 | 8599 | 1 | 2019-10-15 13:41:53 | 1 | Bus |
| 8880 | 8601 | 1 | 2019-10-15 13:41:57 | 1 | Bus |
| 8881 | 8602 | 1 | 2019-10-15 13:42:11 | 1 | Bus |
| 8882 | 8604 | 1 | 2019-10-15 13:42:14 | 1 | Bus |
| 8883 | 8607 | 1 | 2019-10-15 13:42:29 | 1 | Bus |
| 8884 | 8610 | 1 | 2019-10-15 13:42:29 | 1 | Bus |
| 8885 | 8608 | 1 | 2019-10-15 13:42:35 | 1 | Bus |
| 8886 | 8606 | 1 | 2019-10-15 13:42:38 | 1 | Bus |
| 8887 | 8616 | 1 | 2019-10-15 13:42:45 | 1 | Bus |
| 8888 | 8605 | 1 | 2019-10-15 13:42:49 | 1 | Bus |
| 8889 | 8614 | 1 | 2019-10-15 13:42:53 | 1 | Bus |
| 8890 | 8613 | 1 | 2019-10-15 13:43:10 | 1 | Bus |
| 8891 | 8617 | 1 | 2019-10-15 13:43:17 | 1 | Bus |
| 8892 | 8609 | 1 | 2019-10-15 13:43:29 | 1 | Bus |
| 8893 | 8627 | 1 | 2019-10-15 13:44:11 | 1 | Bus |
| 8894 | 8624 | 1 | 2019-10-15 13:44:13 | 1 | Bus |
| 8895 | 8612 | 1 | 2019-10-15 13:44:23 | 1 | Bus |
| 8896 | 8620 | 1 | 2019-10-15 13:44:49 | 1 | Bus |
| 8897 | 8625 | 1 | 2019-10-15 13:45:02 | 1 | Bus |
| 8898 | 8623 | 1 | 2019-10-15 13:45:03 | 1 | Bus |
| 8899 | 8618 | 1 | 2019-10-15 13:45:08 | 1 | Bus |
| 8900 | 8622 | 1 | 2019-10-15 13:45:11 | 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;