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,276–3,300 of 9,738
| scan_idINTEGER | ticket_id→ ticket.ticket_id | entrance_id→ entrance.entrance_id | scanned_atTEXT | is_first_entryINTEGER | transport_modeTEXT |
|---|---|---|---|---|---|
| 3276 | 3123 | 4 | 2017-02-24 11:05:31 | 1 | Bus |
| 3277 | 3130 | 4 | 2017-02-24 11:05:45 | 1 | Bus |
| 3278 | 3118 | 4 | 2017-02-24 11:06:00 | 1 | Bus |
| 3279 | 3121 | 4 | 2017-02-24 11:06:33 | 1 | Bus |
| 3280 | 3113 | 4 | 2017-02-24 11:06:41 | 1 | Bus |
| 3281 | 3127 | 4 | 2017-02-24 11:07:39 | 1 | Bus |
| 3282 | 3124 | 4 | 2017-02-24 11:07:49 | 1 | Bus |
| 3283 | 3136 | 4 | 2017-02-24 11:09:18 | 1 | Bus |
| 3284 | 3122 | 4 | 2017-02-24 11:09:28 | 1 | Bus |
| 3285 | 3126 | 4 | 2017-02-24 11:09:43 | 1 | Bus |
| 3286 | 3499 | 1 | 2017-02-24 13:16:19 | 1 | Other |
| 3287 | 3560 | 1 | 2017-02-26 10:38:56 | 1 | Private Vehicle |
| 3288 | 3520 | 1 | 2017-02-26 13:06:23 | 1 | Bus |
| 3289 | 3518 | 1 | 2017-02-26 13:06:25 | 1 | Bus |
| 3290 | 3519 | 1 | 2017-02-26 13:06:38 | 1 | Bus |
| 3291 | 3569 | 1 | 2017-02-27 10:12:29 | 1 | Walk |
| 3292 | 3568 | 1 | 2017-02-27 10:12:33 | 1 | Walk |
| 3293 | 3553 | 3 | 2017-02-27 14:10:37 | 1 | Metro |
| 3294 | 3554 | 3 | 2017-02-27 14:10:37 | 1 | Metro |
| 3295 | 3555 | 3 | 2017-02-27 14:10:40 | 1 | Metro |
| 3296 | 3571 | 1 | 2017-02-28 09:44:43 | 1 | Train |
| 3297 | 3570 | 1 | 2017-02-28 09:44:51 | 1 | Train |
| 3298 | 3559 | 3 | 2017-02-28 11:50:07 | 1 | Walk |
| 3299 | 3572 | 1 | 2017-03-01 10:39:37 | 1 | Walk |
| 3300 | 3573 | 1 | 2017-03-01 10:39:59 | 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;