Table
entry_scan
Every entrance scan; only the first of the day records how the visitor travelled.
Replaces in 2020: Entrance, Ticket.Transportation
Rows 26–50 of 9,738
| scan_idINTEGER | ticket_id→ ticket.ticket_id | entrance_id→ entrance.entrance_id | scanned_atTEXT | is_first_entryINTEGER | transport_modeTEXT |
|---|---|---|---|---|---|
| 26 | 76 | 5 | 2015-03-08 14:32:44 | 1 | Metro |
| 27 | 67 | 3 | 2015-03-09 11:46:51 | 1 | Metro |
| 28 | 66 | 3 | 2015-03-09 11:47:13 | 1 | Metro |
| 29 | 80 | 3 | 2015-03-09 16:51:54 | 1 | Walk |
| 30 | 101 | 1 | 2015-03-12 12:13:27 | 1 | Metro |
| 31 | 100 | 1 | 2015-03-12 12:13:41 | 1 | Metro |
| 32 | 85 | 1 | 2015-03-12 12:19:55 | 1 | Walk |
| 33 | 83 | 1 | 2015-03-12 12:20:09 | 1 | Walk |
| 34 | 84 | 1 | 2015-03-12 12:20:14 | 1 | Walk |
| 35 | 102 | 1 | 2015-03-13 10:44:57 | 1 | Walk |
| 36 | 94 | 1 | 2015-03-13 11:47:19 | 1 | Walk |
| 37 | 93 | 1 | 2015-03-13 11:47:51 | 1 | Walk |
| 38 | 96 | 1 | 2015-03-13 11:47:55 | 1 | Walk |
| 39 | 103 | 2 | 2015-03-14 11:36:52 | 1 | Metro |
| 40 | 75 | 2 | 2015-03-14 13:16:33 | 1 | Metro |
| 41 | 104 | 2 | 2015-03-14 13:34:56 | 1 | Private Vehicle |
| 42 | 105 | 2 | 2015-03-14 13:35:01 | 1 | Private Vehicle |
| 43 | 97 | 1 | 2015-03-15 09:08:31 | 1 | Walk |
| 44 | 2 | 4 | 2015-03-15 13:40:50 | 1 | Taxi |
| 45 | 1 | 4 | 2015-03-15 13:41:30 | 1 | Taxi |
| 46 | 159 | 2 | 2015-03-21 10:47:08 | 1 | Private Vehicle |
| 47 | 160 | 2 | 2015-03-21 10:47:10 | 1 | Private Vehicle |
| 48 | 161 | 2 | 2015-03-21 10:47:13 | 1 | Private Vehicle |
| 49 | 157 | 2 | 2015-03-21 10:47:18 | 1 | Private Vehicle |
| 50 | 158 | 2 | 2015-03-21 10:47:42 | 1 | Private Vehicle |
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;