Table
entry_scan
Every entrance scan; only the first of the day records how the visitor travelled.
Replaces in 2020: Entrance, Ticket.Transportation
Rows 6,851–6,875 of 9,738
| scan_idINTEGER | ticket_id→ ticket.ticket_id | entrance_id→ entrance.entrance_id | scanned_atTEXT | is_first_entryINTEGER | transport_modeTEXT |
|---|---|---|---|---|---|
| 6851 | 7153 | 2 | 2018-11-22 10:59:28 | 1 | Metro |
| 6852 | 7083 | 1 | 2018-11-23 11:09:35 | 1 | Walk |
| 6853 | 7171 | 1 | 2018-11-23 13:52:08 | 1 | Metro |
| 6854 | 7174 | 1 | 2018-11-23 14:52:08 | 1 | Bus |
| 6855 | 7175 | 1 | 2018-11-23 14:52:12 | 1 | Bus |
| 6856 | 7173 | 1 | 2018-11-23 14:52:41 | 1 | Bus |
| 6857 | 7172 | 1 | 2018-11-23 14:52:43 | 1 | Bus |
| 6858 | 7180 | 1 | 2018-11-24 10:17:53 | 1 | Train |
| 6859 | 7181 | 1 | 2018-11-24 10:17:58 | 1 | Train |
| 6860 | 7191 | 3 | 2018-11-26 10:39:54 | 1 | Walk |
| 6861 | 7190 | 3 | 2018-11-26 10:39:55 | 1 | Walk |
| 6862 | 7193 | 1 | 2018-11-26 12:12:34 | 1 | Metro |
| 6863 | 7195 | 1 | 2018-11-26 12:12:56 | 1 | Metro |
| 6864 | 7192 | 1 | 2018-11-26 12:13:05 | 1 | Metro |
| 6865 | 7194 | 1 | 2018-11-26 12:13:10 | 1 | Metro |
| 6866 | 7160 | 3 | 2018-11-27 14:05:38 | 1 | Metro |
| 6867 | 7161 | 3 | 2018-11-27 14:05:50 | 1 | Metro |
| 6868 | 7158 | 3 | 2018-11-27 14:05:53 | 1 | Metro |
| 6869 | 7162 | 3 | 2018-11-27 14:05:57 | 1 | Metro |
| 6870 | 7159 | 3 | 2018-11-27 14:06:10 | 1 | Metro |
| 6871 | 7147 | 2 | 2018-11-28 09:05:00 | 1 | Private Vehicle |
| 6872 | 7149 | 2 | 2018-11-28 09:05:10 | 1 | Private Vehicle |
| 6873 | 7148 | 2 | 2018-11-28 09:05:14 | 1 | Private Vehicle |
| 6874 | 7146 | 2 | 2018-11-28 09:05:25 | 1 | Private Vehicle |
| 6875 | 7145 | 2 | 2018-11-28 09:05:29 | 1 | Private Vehicle |
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;