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,476–5,500 of 9,738
| scan_idINTEGER | ticket_id→ ticket.ticket_id | entrance_id→ entrance.entrance_id | scanned_atTEXT | is_first_entryINTEGER | transport_modeTEXT |
|---|---|---|---|---|---|
| 5476 | 5097 | 4 | 2018-05-04 12:23:36 | 1 | Bus |
| 5477 | 5108 | 4 | 2018-05-04 12:23:48 | 1 | Bus |
| 5478 | 5098 | 4 | 2018-05-04 12:23:49 | 1 | Bus |
| 5479 | 5100 | 4 | 2018-05-04 12:24:15 | 1 | Bus |
| 5480 | 5111 | 4 | 2018-05-04 12:24:56 | 1 | Bus |
| 5481 | 5101 | 4 | 2018-05-04 12:24:58 | 1 | Bus |
| 5482 | 5104 | 4 | 2018-05-04 12:25:07 | 1 | Bus |
| 5483 | 5103 | 4 | 2018-05-04 12:25:26 | 1 | Bus |
| 5484 | 5116 | 4 | 2018-05-04 12:26:10 | 1 | Bus |
| 5485 | 5106 | 4 | 2018-05-04 12:26:28 | 1 | Bus |
| 5486 | 5110 | 4 | 2018-05-04 12:26:36 | 1 | Bus |
| 5487 | 5122 | 4 | 2018-05-04 12:27:10 | 1 | Bus |
| 5488 | 5115 | 4 | 2018-05-04 12:27:18 | 1 | Bus |
| 5489 | 5120 | 4 | 2018-05-04 12:27:30 | 1 | Bus |
| 5490 | 5117 | 4 | 2018-05-04 12:27:46 | 1 | Bus |
| 5491 | 5687 | 2 | 2018-05-04 15:07:51 | 1 | Metro |
| 5492 | 5688 | 2 | 2018-05-04 15:07:53 | 1 | Metro |
| 5493 | 5691 | 1 | 2018-05-05 09:37:49 | 1 | Walk |
| 5494 | 5692 | 1 | 2018-05-05 09:38:25 | 1 | Walk |
| 5495 | 5694 | 1 | 2018-05-05 10:17:03 | 1 | Metro |
| 5496 | 5693 | 1 | 2018-05-05 10:17:04 | 1 | Metro |
| 5497 | 5690 | 2 | 2018-05-05 13:04:44 | 1 | Metro |
| 5498 | 5698 | 1 | 2018-05-06 09:42:54 | 1 | Metro |
| 5499 | 5697 | 1 | 2018-05-06 09:42:59 | 1 | Metro |
| 5500 | 5700 | 1 | 2018-05-06 09:43:13 | 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;