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,776–7,800 of 9,738
| scan_idINTEGER | ticket_id→ ticket.ticket_id | entrance_id→ entrance.entrance_id | scanned_atTEXT | is_first_entryINTEGER | transport_modeTEXT |
|---|---|---|---|---|---|
| 7776 | 7868 | 1 | 2019-04-15 12:07:25 | 1 | Bus |
| 7777 | 7869 | 1 | 2019-04-15 12:07:34 | 1 | Bus |
| 7778 | 7860 | 1 | 2019-04-15 12:07:37 | 1 | Bus |
| 7779 | 7870 | 1 | 2019-04-15 12:07:43 | 1 | Bus |
| 7780 | 7855 | 1 | 2019-04-15 12:08:06 | 1 | Bus |
| 7781 | 7859 | 1 | 2019-04-15 12:08:30 | 1 | Bus |
| 7782 | 7872 | 1 | 2019-04-15 12:08:44 | 1 | Bus |
| 7783 | 7862 | 1 | 2019-04-15 12:10:19 | 1 | Bus |
| 7784 | 7873 | 1 | 2019-04-15 12:10:22 | 1 | Bus |
| 7785 | 7874 | 1 | 2019-04-15 12:11:19 | 1 | Bus |
| 7786 | 7993 | 1 | 2019-04-16 09:21:18 | 1 | Bus |
| 7787 | 7992 | 1 | 2019-04-16 09:21:27 | 1 | Bus |
| 7788 | 8083 | 4 | 2019-04-16 09:26:37 | 1 | Metro |
| 7789 | 8084 | 4 | 2019-04-16 09:26:40 | 1 | Metro |
| 7790 | 7993 | 1 | 2019-04-16 11:03:05 | 0 | NULL |
| 7791 | 7992 | 1 | 2019-04-16 12:57:01 | 0 | NULL |
| 7792 | 8063 | 4 | 2019-04-16 15:15:02 | 1 | Walk |
| 7793 | 8066 | 4 | 2019-04-16 15:15:08 | 1 | Walk |
| 7794 | 8064 | 4 | 2019-04-16 15:15:09 | 1 | Walk |
| 7795 | 8065 | 4 | 2019-04-16 15:15:42 | 1 | Walk |
| 7796 | 8086 | 1 | 2019-04-17 11:00:07 | 1 | Other |
| 7797 | 7900 | 4 | 2019-04-17 12:51:09 | 1 | Taxi |
| 7798 | 7901 | 4 | 2019-04-17 12:51:53 | 1 | Taxi |
| 7799 | 8087 | 4 | 2019-04-17 15:18:35 | 1 | Walk |
| 7800 | 8085 | 1 | 2019-04-19 09:57:42 | 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;