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,951–4,975 of 9,738
| scan_idINTEGER | ticket_id→ ticket.ticket_id | entrance_id→ entrance.entrance_id | scanned_atTEXT | is_first_entryINTEGER | transport_modeTEXT |
|---|---|---|---|---|---|
| 4951 | 5144 | 1 | 2018-01-15 10:18:33 | 1 | Metro |
| 4952 | 5145 | 1 | 2018-01-15 10:18:55 | 1 | Metro |
| 4953 | 5143 | 1 | 2018-01-15 10:18:56 | 1 | Metro |
| 4954 | 5146 | 5 | 2018-01-15 10:58:50 | 1 | Train |
| 4955 | 5147 | 5 | 2018-01-15 10:59:10 | 1 | Train |
| 4956 | 5123 | 1 | 2018-01-16 11:27:06 | 1 | Bus |
| 4957 | 5044 | 1 | 2018-01-16 13:01:33 | 1 | Walk |
| 4958 | 5200 | 4 | 2018-01-17 12:45:50 | 1 | Other |
| 4959 | 5046 | 3 | 2018-01-17 15:45:20 | 1 | Bus |
| 4960 | 5203 | 1 | 2018-01-18 10:19:44 | 1 | Train |
| 4961 | 5202 | 1 | 2018-01-18 10:19:47 | 1 | Train |
| 4962 | 5201 | 1 | 2018-01-18 10:19:57 | 1 | Train |
| 4963 | 4862 | 2 | 2018-01-18 11:52:28 | 1 | Walk |
| 4964 | 4861 | 2 | 2018-01-18 11:53:04 | 1 | Walk |
| 4965 | 4867 | 5 | 2018-01-19 09:06:53 | 1 | Metro |
| 4966 | 4868 | 5 | 2018-01-19 09:07:12 | 1 | Metro |
| 4967 | 4993 | 1 | 2018-01-19 13:04:09 | 1 | Metro |
| 4968 | 4994 | 1 | 2018-01-19 13:04:17 | 1 | Metro |
| 4969 | 4995 | 1 | 2018-01-19 13:04:33 | 1 | Metro |
| 4970 | 4997 | 1 | 2018-01-19 13:04:41 | 1 | Metro |
| 4971 | 4996 | 1 | 2018-01-19 13:04:45 | 1 | Metro |
| 4972 | 5005 | 1 | 2018-01-19 13:04:57 | 1 | Metro |
| 4973 | 5000 | 1 | 2018-01-19 13:04:58 | 1 | Metro |
| 4974 | 4999 | 1 | 2018-01-19 13:05:03 | 1 | Metro |
| 4975 | 4998 | 1 | 2018-01-19 13:05:04 | 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;