Table
entry_scan
Every entrance scan; only the first of the day records how the visitor travelled.
Replaces in 2020: Entrance, Ticket.Transportation
Rows 1,001–1,025 of 9,738
| scan_idINTEGER | ticket_id→ ticket.ticket_id | entrance_id→ entrance.entrance_id | scanned_atTEXT | is_first_entryINTEGER | transport_modeTEXT |
|---|---|---|---|---|---|
| 1001 | 573 | 4 | 2015-09-03 11:58:24 | 1 | Bus |
| 1002 | 583 | 4 | 2015-09-03 11:58:29 | 1 | Bus |
| 1003 | 581 | 4 | 2015-09-03 11:58:30 | 1 | Bus |
| 1004 | 588 | 4 | 2015-09-03 11:58:42 | 1 | Bus |
| 1005 | 592 | 4 | 2015-09-03 11:58:47 | 1 | Bus |
| 1006 | 589 | 4 | 2015-09-03 12:00:15 | 1 | Bus |
| 1007 | 587 | 4 | 2015-09-03 12:00:17 | 1 | Bus |
| 1008 | 596 | 4 | 2015-09-03 12:00:29 | 1 | Bus |
| 1009 | 594 | 4 | 2015-09-03 12:01:48 | 1 | Bus |
| 1010 | 593 | 4 | 2015-09-03 12:02:39 | 1 | Bus |
| 1011 | 595 | 4 | 2015-09-03 12:03:09 | 1 | Bus |
| 1012 | 1067 | 1 | 2015-09-04 10:02:32 | 1 | Metro |
| 1013 | 1063 | 5 | 2015-09-04 11:47:37 | 1 | Metro |
| 1014 | 1062 | 5 | 2015-09-04 11:47:53 | 1 | Metro |
| 1015 | 1068 | 1 | 2015-09-05 11:32:36 | 1 | Metro |
| 1016 | 1025 | 4 | 2015-09-05 14:01:17 | 1 | Metro |
| 1017 | 1023 | 4 | 2015-09-05 14:01:26 | 1 | Metro |
| 1018 | 1024 | 4 | 2015-09-05 14:01:30 | 1 | Metro |
| 1019 | 1026 | 4 | 2015-09-05 14:01:31 | 1 | Metro |
| 1020 | 1069 | 2 | 2015-09-05 14:22:52 | 1 | Metro |
| 1021 | 989 | 1 | 2015-09-06 16:29:47 | 1 | Walk |
| 1022 | 1073 | 4 | 2015-09-07 14:35:52 | 1 | Metro |
| 1023 | 1072 | 4 | 2015-09-07 14:36:15 | 1 | Metro |
| 1024 | 1021 | 1 | 2015-09-08 14:36:57 | 1 | Metro |
| 1025 | 1020 | 1 | 2015-09-08 14:37:14 | 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;