Table
entry_scan
Every entrance scan; only the first of the day records how the visitor travelled.
Replaces in 2020: Entrance, Ticket.Transportation
Rows 3,101–3,125 of 9,738
| scan_idINTEGER | ticket_id→ ticket.ticket_id | entrance_id→ entrance.entrance_id | scanned_atTEXT | is_first_entryINTEGER | transport_modeTEXT |
|---|---|---|---|---|---|
| 3101 | 3330 | 1 | 2016-12-30 11:47:06 | 1 | Walk |
| 3102 | 3332 | 1 | 2016-12-30 14:45:42 | 1 | Train |
| 3103 | 3325 | 2 | 2016-12-31 12:54:38 | 1 | Metro |
| 3104 | 3328 | 2 | 2016-12-31 12:54:46 | 1 | Metro |
| 3105 | 3327 | 2 | 2016-12-31 12:54:52 | 1 | Metro |
| 3106 | 3329 | 2 | 2016-12-31 12:54:58 | 1 | Metro |
| 3107 | 3328 | 2 | 2016-12-31 15:31:34 | 0 | NULL |
| 3108 | 3329 | 2 | 2016-12-31 15:51:34 | 0 | NULL |
| 3109 | 3327 | 2 | 2016-12-31 16:33:59 | 0 | NULL |
| 3110 | 3325 | 3 | 2016-12-31 16:41:14 | 0 | NULL |
| 3111 | 3339 | 2 | 2017-01-02 14:36:04 | 1 | Metro |
| 3112 | 3250 | 1 | 2017-01-05 09:37:17 | 1 | Private Vehicle |
| 3113 | 3248 | 1 | 2017-01-05 09:37:18 | 1 | Private Vehicle |
| 3114 | 3249 | 1 | 2017-01-05 09:37:24 | 1 | Private Vehicle |
| 3115 | 3341 | 1 | 2017-01-05 10:57:20 | 1 | Walk |
| 3116 | 3384 | 2 | 2017-01-06 10:25:38 | 1 | Metro |
| 3117 | 3383 | 2 | 2017-01-06 10:25:40 | 1 | Metro |
| 3118 | 3321 | 3 | 2017-01-06 10:47:09 | 1 | Metro |
| 3119 | 3320 | 3 | 2017-01-06 10:47:29 | 1 | Metro |
| 3120 | 3335 | 1 | 2017-01-07 09:18:40 | 1 | Bus |
| 3121 | 3340 | 2 | 2017-01-07 10:55:57 | 1 | Walk |
| 3122 | 3385 | 2 | 2017-01-07 11:55:46 | 1 | Metro |
| 3123 | 3387 | 2 | 2017-01-07 11:55:52 | 1 | Metro |
| 3124 | 3386 | 2 | 2017-01-07 11:55:56 | 1 | Metro |
| 3125 | 3388 | 4 | 2017-01-07 15:06:06 | 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;