Table
entry_scan
Every entrance scan; only the first of the day records how the visitor travelled.
Replaces in 2020: Entrance, Ticket.Transportation
Rows 9,701–9,725 of 9,738
| scan_idINTEGER | ticket_id→ ticket.ticket_id | entrance_id→ entrance.entrance_id | scanned_atTEXT | is_first_entryINTEGER | transport_modeTEXT |
|---|---|---|---|---|---|
| 9701 | 9812 | 1 | 2020-02-18 14:00:02 | 1 | Taxi |
| 9702 | 9812 | 1 | 2020-02-18 15:49:35 | 0 | NULL |
| 9703 | 9820 | 1 | 2020-02-19 12:49:39 | 1 | Train |
| 9704 | 9822 | 1 | 2020-02-19 12:49:59 | 1 | Train |
| 9705 | 9823 | 1 | 2020-02-19 12:50:16 | 1 | Train |
| 9706 | 9819 | 1 | 2020-02-19 12:50:22 | 1 | Train |
| 9707 | 9821 | 1 | 2020-02-19 12:50:23 | 1 | Train |
| 9708 | 9829 | 2 | 2020-02-19 16:33:20 | 1 | Metro |
| 9709 | 9828 | 2 | 2020-02-19 16:33:26 | 1 | Metro |
| 9710 | 9830 | 4 | 2020-02-20 10:56:31 | 1 | Walk |
| 9711 | 9800 | 1 | 2020-02-20 14:51:59 | 1 | Train |
| 9712 | 9797 | 1 | 2020-02-20 14:52:09 | 1 | Train |
| 9713 | 9798 | 1 | 2020-02-20 14:52:22 | 1 | Train |
| 9714 | 9799 | 1 | 2020-02-20 14:52:26 | 1 | Train |
| 9715 | 9801 | 1 | 2020-02-20 14:52:27 | 1 | Train |
| 9716 | 9831 | 2 | 2020-02-22 09:52:49 | 1 | Bus |
| 9717 | 9832 | 2 | 2020-02-22 09:53:29 | 1 | Bus |
| 9718 | 9735 | 3 | 2020-02-23 10:44:41 | 1 | Private Vehicle |
| 9719 | 9734 | 3 | 2020-02-23 10:44:44 | 1 | Private Vehicle |
| 9720 | 9747 | 3 | 2020-02-23 11:38:03 | 1 | Metro |
| 9721 | 9749 | 3 | 2020-02-23 11:38:16 | 1 | Metro |
| 9722 | 9748 | 3 | 2020-02-23 11:38:37 | 1 | Metro |
| 9723 | 9746 | 3 | 2020-02-23 11:38:38 | 1 | Metro |
| 9724 | 9824 | 1 | 2020-02-23 14:42:08 | 1 | Other |
| 9725 | 9827 | 1 | 2020-02-23 14:42:30 | 1 | Other |
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;