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,726–7,750 of 9,738
| scan_idINTEGER | ticket_id→ ticket.ticket_id | entrance_id→ entrance.entrance_id | scanned_atTEXT | is_first_entryINTEGER | transport_modeTEXT |
|---|---|---|---|---|---|
| 7726 | 8076 | 1 | 2019-04-14 13:43:04 | 1 | Walk |
| 7727 | 8071 | 2 | 2019-04-14 13:49:11 | 0 | NULL |
| 7728 | 8068 | 4 | 2019-04-14 15:46:20 | 1 | Taxi |
| 7729 | 8070 | 4 | 2019-04-14 15:46:41 | 1 | Taxi |
| 7730 | 8069 | 4 | 2019-04-14 15:46:55 | 1 | Taxi |
| 7731 | 8067 | 4 | 2019-04-14 15:47:00 | 1 | Taxi |
| 7732 | 8043 | 1 | 2019-04-15 09:13:39 | 1 | Other |
| 7733 | 8044 | 1 | 2019-04-15 09:14:18 | 1 | Other |
| 7734 | 8077 | 1 | 2019-04-15 10:10:08 | 1 | Metro |
| 7735 | 8052 | 2 | 2019-04-15 10:56:47 | 1 | Metro |
| 7736 | 8054 | 2 | 2019-04-15 10:56:53 | 1 | Metro |
| 7737 | 8055 | 2 | 2019-04-15 10:57:10 | 1 | Metro |
| 7738 | 8051 | 2 | 2019-04-15 10:57:17 | 1 | Metro |
| 7739 | 8053 | 2 | 2019-04-15 10:57:35 | 1 | Metro |
| 7740 | 7825 | 1 | 2019-04-15 12:01:34 | 1 | Bus |
| 7741 | 7826 | 1 | 2019-04-15 12:01:48 | 1 | Bus |
| 7742 | 7828 | 1 | 2019-04-15 12:01:52 | 1 | Bus |
| 7743 | 7827 | 1 | 2019-04-15 12:01:58 | 1 | Bus |
| 7744 | 7829 | 1 | 2019-04-15 12:02:06 | 1 | Bus |
| 7745 | 7832 | 1 | 2019-04-15 12:02:09 | 1 | Bus |
| 7746 | 7830 | 1 | 2019-04-15 12:02:19 | 1 | Bus |
| 7747 | 7834 | 1 | 2019-04-15 12:02:38 | 1 | Bus |
| 7748 | 7841 | 1 | 2019-04-15 12:02:44 | 1 | Bus |
| 7749 | 7831 | 1 | 2019-04-15 12:02:52 | 1 | Bus |
| 7750 | 7849 | 1 | 2019-04-15 12:03:02 | 1 | Bus |
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;