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,901–8,925 of 9,738
| scan_idINTEGER | ticket_id→ ticket.ticket_id | entrance_id→ entrance.entrance_id | scanned_atTEXT | is_first_entryINTEGER | transport_modeTEXT |
|---|---|---|---|---|---|
| 8901 | 8621 | 1 | 2019-10-15 13:45:34 | 1 | Bus |
| 8902 | 8629 | 1 | 2019-10-15 13:45:38 | 1 | Bus |
| 8903 | 8626 | 1 | 2019-10-15 13:46:17 | 1 | Bus |
| 8904 | 8628 | 1 | 2019-10-15 13:47:29 | 1 | Bus |
| 8905 | 8630 | 1 | 2019-10-15 13:47:31 | 1 | Bus |
| 8906 | 9138 | 1 | 2019-10-16 11:00:50 | 1 | Walk |
| 8907 | 9139 | 1 | 2019-10-16 11:01:10 | 1 | Walk |
| 8908 | 9168 | 1 | 2019-10-16 14:05:43 | 1 | Metro |
| 8909 | 9169 | 1 | 2019-10-16 14:05:55 | 1 | Metro |
| 8910 | 9178 | 1 | 2019-10-17 09:03:41 | 1 | Bus |
| 8911 | 9177 | 1 | 2019-10-17 09:03:50 | 1 | Bus |
| 8912 | 9087 | 5 | 2019-10-17 09:48:28 | 1 | Metro |
| 8913 | 9129 | 1 | 2019-10-17 10:55:53 | 1 | Bus |
| 8914 | 9130 | 1 | 2019-10-17 10:56:01 | 1 | Bus |
| 8915 | 9128 | 1 | 2019-10-17 10:56:30 | 1 | Bus |
| 8916 | 9228 | 4 | 2019-10-17 15:25:03 | 1 | Walk |
| 8917 | 9229 | 4 | 2019-10-17 15:25:21 | 1 | Walk |
| 8918 | 9179 | 1 | 2019-10-18 09:26:24 | 1 | Private Vehicle |
| 8919 | 9235 | 1 | 2019-10-18 10:23:02 | 1 | Bus |
| 8920 | 9234 | 1 | 2019-10-18 10:23:15 | 1 | Bus |
| 8921 | 9235 | 1 | 2019-10-18 13:29:08 | 0 | NULL |
| 8922 | 9234 | 1 | 2019-10-18 13:44:25 | 0 | NULL |
| 8923 | 9155 | 4 | 2019-10-18 16:47:41 | 1 | Bus |
| 8924 | 9154 | 4 | 2019-10-18 16:47:43 | 1 | Bus |
| 8925 | 9239 | 3 | 2019-10-19 10:39:48 | 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;