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,501–3,525 of 9,738
| scan_idINTEGER | ticket_id→ ticket.ticket_id | entrance_id→ entrance.entrance_id | scanned_atTEXT | is_first_entryINTEGER | transport_modeTEXT |
|---|---|---|---|---|---|
| 3501 | 3708 | 3 | 2017-04-04 13:44:18 | 1 | Bus |
| 3502 | 3710 | 3 | 2017-04-04 13:44:47 | 1 | Bus |
| 3503 | 3708 | 3 | 2017-04-04 15:53:59 | 0 | NULL |
| 3504 | 3710 | 2 | 2017-04-04 17:05:58 | 0 | NULL |
| 3505 | 3709 | 3 | 2017-04-04 17:09:23 | 0 | NULL |
| 3506 | 3693 | 1 | 2017-04-05 13:55:24 | 1 | Walk |
| 3507 | 3682 | 2 | 2017-04-06 10:46:41 | 1 | Metro |
| 3508 | 3681 | 2 | 2017-04-06 10:46:54 | 1 | Metro |
| 3509 | 3725 | 1 | 2017-04-06 13:06:39 | 1 | Metro |
| 3510 | 3726 | 1 | 2017-04-06 13:07:04 | 1 | Metro |
| 3511 | 3186 | 1 | 2017-04-06 13:15:54 | 1 | Bus |
| 3512 | 3187 | 1 | 2017-04-06 13:16:01 | 1 | Bus |
| 3513 | 3188 | 1 | 2017-04-06 13:16:08 | 1 | Bus |
| 3514 | 3189 | 1 | 2017-04-06 13:16:30 | 1 | Bus |
| 3515 | 3192 | 1 | 2017-04-06 13:16:36 | 1 | Bus |
| 3516 | 3190 | 1 | 2017-04-06 13:16:38 | 1 | Bus |
| 3517 | 3191 | 1 | 2017-04-06 13:16:49 | 1 | Bus |
| 3518 | 3202 | 1 | 2017-04-06 13:17:00 | 1 | Bus |
| 3519 | 3209 | 1 | 2017-04-06 13:17:09 | 1 | Bus |
| 3520 | 3218 | 1 | 2017-04-06 13:17:22 | 1 | Bus |
| 3521 | 3199 | 1 | 2017-04-06 13:17:24 | 1 | Bus |
| 3522 | 3195 | 1 | 2017-04-06 13:17:25 | 1 | Bus |
| 3523 | 3203 | 1 | 2017-04-06 13:17:30 | 1 | Bus |
| 3524 | 3223 | 1 | 2017-04-06 13:17:38 | 1 | Bus |
| 3525 | 3198 | 1 | 2017-04-06 13:17:54 | 1 | Bus |
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;