Table
entry_scan
Every entrance scan; only the first of the day records how the visitor travelled.
Replaces in 2020: Entrance, Ticket.Transportation
Rows 5,676–5,700 of 9,738
| scan_idINTEGER | ticket_id→ ticket.ticket_id | entrance_id→ entrance.entrance_id | scanned_atTEXT | is_first_entryINTEGER | transport_modeTEXT |
|---|---|---|---|---|---|
| 5676 | 5822 | 1 | 2018-06-01 10:32:19 | 1 | Train |
| 5677 | 5817 | 2 | 2018-06-01 11:45:55 | 1 | Walk |
| 5678 | 5892 | 2 | 2018-06-02 10:48:09 | 1 | Metro |
| 5679 | 5891 | 2 | 2018-06-02 10:48:18 | 1 | Metro |
| 5680 | 5885 | 4 | 2018-06-02 11:40:28 | 1 | Walk |
| 5681 | 5813 | 3 | 2018-06-02 11:44:11 | 1 | Private Vehicle |
| 5682 | 5814 | 3 | 2018-06-02 11:44:38 | 1 | Private Vehicle |
| 5683 | 5795 | 1 | 2018-06-02 12:34:52 | 1 | Walk |
| 5684 | 5796 | 1 | 2018-06-02 12:35:26 | 1 | Walk |
| 5685 | 5893 | 1 | 2018-06-02 14:06:02 | 1 | Bus |
| 5686 | 5885 | 2 | 2018-06-02 14:06:42 | 0 | NULL |
| 5687 | 5894 | 1 | 2018-06-04 10:03:12 | 1 | Walk |
| 5688 | 5895 | 1 | 2018-06-04 10:03:17 | 1 | Walk |
| 5689 | 5939 | 1 | 2018-06-04 10:32:44 | 1 | Bus |
| 5690 | 5705 | 1 | 2018-06-04 11:52:00 | 1 | Taxi |
| 5691 | 5878 | 1 | 2018-06-05 13:31:14 | 1 | Metro |
| 5692 | 5881 | 1 | 2018-06-05 13:31:29 | 1 | Metro |
| 5693 | 5879 | 1 | 2018-06-05 13:31:50 | 1 | Metro |
| 5694 | 5880 | 1 | 2018-06-05 13:31:59 | 1 | Metro |
| 5695 | 5945 | 5 | 2018-06-06 12:32:39 | 1 | Private Vehicle |
| 5696 | 5944 | 5 | 2018-06-06 12:32:40 | 1 | Private Vehicle |
| 5697 | 5943 | 5 | 2018-06-06 12:32:48 | 1 | Private Vehicle |
| 5698 | 5942 | 5 | 2018-06-06 12:33:02 | 1 | Private Vehicle |
| 5699 | 5954 | 1 | 2018-06-07 10:48:00 | 1 | Metro |
| 5700 | 5955 | 1 | 2018-06-07 10:48:17 | 1 | Metro |
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;