Table
entry_scan
Every entrance scan; only the first of the day records how the visitor travelled.
Replaces in 2020: Entrance, Ticket.Transportation
Rows 4,876–4,900 of 9,738
| scan_idINTEGER | ticket_id→ ticket.ticket_id | entrance_id→ entrance.entrance_id | scanned_atTEXT | is_first_entryINTEGER | transport_modeTEXT |
|---|---|---|---|---|---|
| 4876 | 4970 | 4 | 2017-12-19 11:27:05 | 1 | Bus |
| 4877 | 4952 | 3 | 2017-12-20 10:27:08 | 1 | Bus |
| 4878 | 4954 | 3 | 2017-12-20 10:27:13 | 1 | Bus |
| 4879 | 4953 | 3 | 2017-12-20 10:27:25 | 1 | Bus |
| 4880 | 4955 | 3 | 2017-12-20 10:27:49 | 1 | Bus |
| 4881 | 4942 | 1 | 2017-12-20 16:50:51 | 1 | Metro |
| 4882 | 4943 | 1 | 2017-12-20 16:50:57 | 1 | Metro |
| 4883 | 4826 | 2 | 2017-12-21 13:24:24 | 1 | Metro |
| 4884 | 4824 | 2 | 2017-12-21 13:24:30 | 1 | Metro |
| 4885 | 4825 | 2 | 2017-12-21 13:24:49 | 1 | Metro |
| 4886 | 4947 | 4 | 2017-12-22 11:51:45 | 1 | Walk |
| 4887 | 4984 | 2 | 2017-12-23 10:45:00 | 1 | Private Vehicle |
| 4888 | 4982 | 2 | 2017-12-23 10:45:03 | 1 | Private Vehicle |
| 4889 | 4981 | 2 | 2017-12-23 10:45:09 | 1 | Private Vehicle |
| 4890 | 4985 | 2 | 2017-12-23 10:45:14 | 1 | Private Vehicle |
| 4891 | 4983 | 2 | 2017-12-23 10:45:26 | 1 | Private Vehicle |
| 4892 | 4951 | 4 | 2017-12-24 09:41:22 | 1 | Bus |
| 4893 | 4949 | 4 | 2017-12-24 09:41:35 | 1 | Bus |
| 4894 | 4950 | 4 | 2017-12-24 09:41:57 | 1 | Bus |
| 4895 | 4988 | 2 | 2017-12-24 10:02:15 | 1 | Walk |
| 4896 | 4989 | 2 | 2017-12-24 10:02:15 | 1 | Walk |
| 4897 | 4987 | 1 | 2017-12-24 11:59:47 | 1 | Taxi |
| 4898 | 4986 | 1 | 2017-12-24 11:59:55 | 1 | Taxi |
| 4899 | 4976 | 3 | 2017-12-24 13:41:15 | 1 | Walk |
| 4900 | 4977 | 3 | 2017-12-24 13:41:16 | 1 | Walk |
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;