Table
entry_scan
Every entrance scan; only the first of the day records how the visitor travelled.
Replaces in 2020: Entrance, Ticket.Transportation
Rows 1,826–1,850 of 9,738
| scan_idINTEGER | ticket_id→ ticket.ticket_id | entrance_id→ entrance.entrance_id | scanned_atTEXT | is_first_entryINTEGER | transport_modeTEXT |
|---|---|---|---|---|---|
| 1826 | 1721 | 4 | 2016-03-18 12:42:08 | 1 | Bus |
| 1827 | 1723 | 4 | 2016-03-18 12:42:24 | 1 | Bus |
| 1828 | 1720 | 4 | 2016-03-18 12:42:26 | 1 | Bus |
| 1829 | 1724 | 4 | 2016-03-18 12:42:32 | 1 | Bus |
| 1830 | 1729 | 4 | 2016-03-18 12:43:04 | 1 | Bus |
| 1831 | 1730 | 4 | 2016-03-18 12:43:12 | 1 | Bus |
| 1832 | 1716 | 4 | 2016-03-18 12:43:18 | 1 | Bus |
| 1833 | 1718 | 4 | 2016-03-18 12:43:20 | 1 | Bus |
| 1834 | 1731 | 4 | 2016-03-18 12:43:20 | 1 | Bus |
| 1835 | 1727 | 4 | 2016-03-18 12:44:56 | 1 | Bus |
| 1836 | 1728 | 4 | 2016-03-18 12:45:41 | 1 | Bus |
| 1837 | 1955 | 1 | 2016-03-19 11:16:48 | 1 | Metro |
| 1838 | 1955 | 1 | 2016-03-19 14:50:54 | 0 | NULL |
| 1839 | 1963 | 1 | 2016-03-19 15:20:36 | 1 | Metro |
| 1840 | 1960 | 1 | 2016-03-19 15:20:59 | 1 | Metro |
| 1841 | 1962 | 1 | 2016-03-19 15:21:09 | 1 | Metro |
| 1842 | 1961 | 1 | 2016-03-19 15:21:15 | 1 | Metro |
| 1843 | 1967 | 1 | 2016-03-20 09:18:44 | 1 | Walk |
| 1844 | 1968 | 1 | 2016-03-20 09:19:05 | 1 | Walk |
| 1845 | 1974 | 1 | 2016-03-20 09:37:00 | 1 | Metro |
| 1846 | 1973 | 1 | 2016-03-20 09:37:40 | 1 | Metro |
| 1847 | 1975 | 1 | 2016-03-20 09:37:47 | 1 | Metro |
| 1848 | 1880 | 2 | 2016-03-20 11:25:56 | 1 | Walk |
| 1849 | 1881 | 2 | 2016-03-20 11:26:06 | 1 | Walk |
| 1850 | 1880 | 2 | 2016-03-20 14:11:35 | 0 | NULL |
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;