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,551–5,575 of 9,738
| scan_idINTEGER | ticket_id→ ticket.ticket_id | entrance_id→ entrance.entrance_id | scanned_atTEXT | is_first_entryINTEGER | transport_modeTEXT |
|---|---|---|---|---|---|
| 5551 | 5421 | 4 | 2018-05-07 12:00:07 | 1 | Bus |
| 5552 | 5404 | 4 | 2018-05-07 12:00:16 | 1 | Bus |
| 5553 | 5409 | 4 | 2018-05-07 12:00:27 | 1 | Bus |
| 5554 | 5417 | 4 | 2018-05-07 12:01:31 | 1 | Bus |
| 5555 | 5410 | 4 | 2018-05-07 12:01:46 | 1 | Bus |
| 5556 | 5416 | 4 | 2018-05-07 12:01:58 | 1 | Bus |
| 5557 | 5426 | 4 | 2018-05-07 12:02:30 | 1 | Bus |
| 5558 | 5420 | 4 | 2018-05-07 12:04:16 | 1 | Bus |
| 5559 | 5425 | 4 | 2018-05-07 12:04:43 | 1 | Bus |
| 5560 | 5669 | 4 | 2018-05-07 15:13:51 | 1 | Walk |
| 5561 | 5704 | 1 | 2018-05-08 11:16:03 | 1 | Metro |
| 5562 | 5706 | 2 | 2018-05-09 13:48:51 | 1 | Metro |
| 5563 | 5582 | 1 | 2018-05-10 09:00:39 | 1 | Walk |
| 5564 | 5684 | 2 | 2018-05-11 10:03:52 | 1 | Metro |
| 5565 | 5683 | 2 | 2018-05-11 10:04:15 | 1 | Metro |
| 5566 | 5674 | 2 | 2018-05-11 13:39:28 | 1 | Other |
| 5567 | 5675 | 2 | 2018-05-11 13:39:48 | 1 | Other |
| 5568 | 5675 | 2 | 2018-05-11 15:55:48 | 0 | NULL |
| 5569 | 5701 | 1 | 2018-05-11 15:56:54 | 1 | Metro |
| 5570 | 5674 | 4 | 2018-05-11 16:40:48 | 0 | NULL |
| 5571 | 5748 | 4 | 2018-05-12 11:52:41 | 1 | Walk |
| 5572 | 5749 | 4 | 2018-05-12 11:52:44 | 1 | Walk |
| 5573 | 5757 | 1 | 2018-05-12 15:50:35 | 1 | Metro |
| 5574 | 5756 | 1 | 2018-05-12 15:51:04 | 1 | Metro |
| 5575 | 5740 | 1 | 2018-05-13 09:29:01 | 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;