Table
entry_scan
Every entrance scan; only the first of the day records how the visitor travelled.
Replaces in 2020: Entrance, Ticket.Transportation
Rows 7,651–7,675 of 9,738
| scan_idINTEGER | ticket_id→ ticket.ticket_id | entrance_id→ entrance.entrance_id | scanned_atTEXT | is_first_entryINTEGER | transport_modeTEXT |
|---|---|---|---|---|---|
| 7651 | 7315 | 1 | 2019-04-02 10:02:36 | 1 | Bus |
| 7652 | 7322 | 1 | 2019-04-02 10:02:43 | 1 | Bus |
| 7653 | 7321 | 1 | 2019-04-02 10:03:12 | 1 | Bus |
| 7654 | 7324 | 1 | 2019-04-02 10:03:30 | 1 | Bus |
| 7655 | 7320 | 1 | 2019-04-02 10:03:37 | 1 | Bus |
| 7656 | 7328 | 1 | 2019-04-02 10:03:57 | 1 | Bus |
| 7657 | 7319 | 1 | 2019-04-02 10:04:14 | 1 | Bus |
| 7658 | 7327 | 1 | 2019-04-02 10:04:54 | 1 | Bus |
| 7659 | 7325 | 1 | 2019-04-02 10:05:45 | 1 | Bus |
| 7660 | 7919 | 1 | 2019-04-02 10:06:41 | 1 | Walk |
| 7661 | 7918 | 1 | 2019-04-02 10:07:18 | 1 | Walk |
| 7662 | 7882 | 2 | 2019-04-03 09:26:58 | 1 | Private Vehicle |
| 7663 | 7883 | 2 | 2019-04-03 09:26:59 | 1 | Private Vehicle |
| 7664 | 7931 | 1 | 2019-04-03 12:06:26 | 1 | Walk |
| 7665 | 7930 | 1 | 2019-04-03 12:07:05 | 1 | Walk |
| 7666 | 7882 | 2 | 2019-04-03 12:34:33 | 0 | NULL |
| 7667 | 7883 | 2 | 2019-04-03 13:00:35 | 0 | NULL |
| 7668 | 7974 | 4 | 2019-04-03 15:56:05 | 1 | Walk |
| 7669 | 7973 | 4 | 2019-04-03 15:56:24 | 1 | Walk |
| 7670 | 7803 | 2 | 2019-04-04 09:43:35 | 1 | Metro |
| 7671 | 7928 | 1 | 2019-04-04 11:46:00 | 1 | Train |
| 7672 | 7926 | 1 | 2019-04-04 11:46:12 | 1 | Train |
| 7673 | 7927 | 1 | 2019-04-04 11:46:35 | 1 | Train |
| 7674 | 7929 | 1 | 2019-04-04 11:46:35 | 1 | Train |
| 7675 | 7649 | 1 | 2019-04-05 11:04:09 | 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;