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,401–5,425 of 9,738
| scan_idINTEGER | ticket_id→ ticket.ticket_id | entrance_id→ entrance.entrance_id | scanned_atTEXT | is_first_entryINTEGER | transport_modeTEXT |
|---|---|---|---|---|---|
| 5401 | 5636 | 5 | 2018-04-25 11:10:53 | 1 | Walk |
| 5402 | 5646 | 2 | 2018-04-25 13:00:13 | 1 | Walk |
| 5403 | 5645 | 2 | 2018-04-25 13:00:33 | 1 | Walk |
| 5404 | 5651 | 2 | 2018-04-25 14:40:18 | 1 | Bus |
| 5405 | 5648 | 2 | 2018-04-25 14:40:24 | 1 | Bus |
| 5406 | 5650 | 2 | 2018-04-25 14:40:27 | 1 | Bus |
| 5407 | 5647 | 2 | 2018-04-25 14:40:35 | 1 | Bus |
| 5408 | 5649 | 2 | 2018-04-25 14:40:47 | 1 | Bus |
| 5409 | 5653 | 4 | 2018-04-26 09:49:05 | 1 | Bus |
| 5410 | 5654 | 4 | 2018-04-26 09:49:23 | 1 | Bus |
| 5411 | 5499 | 1 | 2018-04-26 14:05:45 | 1 | Walk |
| 5412 | 5641 | 4 | 2018-04-26 15:00:10 | 1 | Bus |
| 5413 | 5640 | 4 | 2018-04-26 15:00:29 | 1 | Bus |
| 5414 | 5662 | 1 | 2018-04-27 10:33:06 | 1 | Walk |
| 5415 | 5661 | 1 | 2018-04-27 10:33:22 | 1 | Walk |
| 5416 | 5585 | 2 | 2018-04-27 10:56:07 | 1 | Private Vehicle |
| 5417 | 5586 | 2 | 2018-04-27 10:56:08 | 1 | Private Vehicle |
| 5418 | 5658 | 5 | 2018-04-27 13:53:26 | 1 | Metro |
| 5419 | 5657 | 5 | 2018-04-27 13:54:14 | 1 | Metro |
| 5420 | 5663 | 1 | 2018-04-28 09:09:33 | 1 | Taxi |
| 5421 | 5668 | 1 | 2018-04-28 10:32:33 | 1 | Metro |
| 5422 | 5667 | 1 | 2018-04-28 10:32:45 | 1 | Metro |
| 5423 | 5665 | 1 | 2018-04-28 10:32:51 | 1 | Metro |
| 5424 | 5666 | 1 | 2018-04-28 10:32:58 | 1 | Metro |
| 5425 | 5664 | 1 | 2018-04-28 10:33:08 | 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;