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,201–7,225 of 9,738
| scan_idINTEGER | ticket_id→ ticket.ticket_id | entrance_id→ entrance.entrance_id | scanned_atTEXT | is_first_entryINTEGER | transport_modeTEXT |
|---|---|---|---|---|---|
| 7201 | 7384 | 3 | 2019-01-17 11:52:11 | 1 | Metro |
| 7202 | 7454 | 2 | 2019-01-19 09:11:06 | 1 | Private Vehicle |
| 7203 | 7456 | 2 | 2019-01-19 09:11:10 | 1 | Private Vehicle |
| 7204 | 7453 | 2 | 2019-01-19 09:11:32 | 1 | Private Vehicle |
| 7205 | 7455 | 2 | 2019-01-19 09:11:48 | 1 | Private Vehicle |
| 7206 | 7457 | 2 | 2019-01-19 10:46:59 | 1 | Metro |
| 7207 | 7459 | 1 | 2019-01-19 12:09:00 | 1 | Walk |
| 7208 | 7458 | 1 | 2019-01-19 12:09:13 | 1 | Walk |
| 7209 | 7205 | 1 | 2019-01-20 09:39:41 | 1 | Other |
| 7210 | 7206 | 1 | 2019-01-20 09:39:42 | 1 | Other |
| 7211 | 7207 | 1 | 2019-01-20 09:39:45 | 1 | Other |
| 7212 | 7468 | 1 | 2019-01-23 10:06:32 | 1 | Metro |
| 7213 | 7469 | 1 | 2019-01-23 10:07:14 | 1 | Metro |
| 7214 | 7452 | 2 | 2019-01-24 14:42:53 | 1 | Walk |
| 7215 | 7470 | 2 | 2019-01-24 15:04:23 | 1 | Metro |
| 7216 | 7471 | 2 | 2019-01-24 15:04:34 | 1 | Metro |
| 7217 | 7467 | 4 | 2019-01-25 16:48:37 | 1 | Metro |
| 7218 | 7466 | 4 | 2019-01-25 16:48:46 | 1 | Metro |
| 7219 | 7472 | 2 | 2019-01-27 12:13:16 | 1 | Bus |
| 7220 | 7447 | 4 | 2019-01-28 10:49:21 | 1 | Metro |
| 7221 | 7446 | 4 | 2019-01-28 10:50:05 | 1 | Metro |
| 7222 | 7473 | 1 | 2019-01-29 09:58:48 | 1 | Metro |
| 7223 | 7450 | 2 | 2019-01-30 09:09:10 | 1 | Metro |
| 7224 | 7449 | 2 | 2019-01-30 09:09:19 | 1 | Metro |
| 7225 | 7526 | 1 | 2019-01-30 11:59:43 | 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;