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,751–1,775 of 9,738
| scan_idINTEGER | ticket_id→ ticket.ticket_id | entrance_id→ entrance.entrance_id | scanned_atTEXT | is_first_entryINTEGER | transport_modeTEXT |
|---|---|---|---|---|---|
| 1751 | 1488 | 1 | 2016-03-03 10:40:49 | 1 | Bus |
| 1752 | 1489 | 1 | 2016-03-03 10:41:04 | 1 | Bus |
| 1753 | 1493 | 1 | 2016-03-03 10:42:04 | 1 | Bus |
| 1754 | 1496 | 1 | 2016-03-03 10:42:15 | 1 | Bus |
| 1755 | 1498 | 1 | 2016-03-03 10:43:19 | 1 | Bus |
| 1756 | 1499 | 1 | 2016-03-03 10:43:34 | 1 | Bus |
| 1757 | 1798 | 1 | 2016-03-04 09:01:18 | 1 | Walk |
| 1758 | 1823 | 2 | 2016-03-05 13:04:40 | 1 | Metro |
| 1759 | 1824 | 2 | 2016-03-05 13:04:57 | 1 | Metro |
| 1760 | 1824 | 2 | 2016-03-05 15:40:02 | 0 | NULL |
| 1761 | 1823 | 2 | 2016-03-05 16:49:56 | 0 | NULL |
| 1762 | 1865 | 4 | 2016-03-06 10:42:44 | 1 | Metro |
| 1763 | 1864 | 4 | 2016-03-06 10:42:46 | 1 | Metro |
| 1764 | 1863 | 1 | 2016-03-06 10:56:11 | 1 | Metro |
| 1765 | 1859 | 1 | 2016-03-06 10:56:17 | 1 | Metro |
| 1766 | 1861 | 1 | 2016-03-06 10:56:17 | 1 | Metro |
| 1767 | 1860 | 1 | 2016-03-06 10:56:22 | 1 | Metro |
| 1768 | 1862 | 1 | 2016-03-06 10:56:35 | 1 | Metro |
| 1769 | 1866 | 1 | 2016-03-07 10:25:06 | 1 | Bus |
| 1770 | 1867 | 1 | 2016-03-07 10:25:39 | 1 | Bus |
| 1771 | 1808 | 2 | 2016-03-08 10:01:55 | 1 | Metro |
| 1772 | 1878 | 2 | 2016-03-09 12:55:20 | 1 | Bus |
| 1773 | 1879 | 2 | 2016-03-09 12:56:01 | 1 | Bus |
| 1774 | 1839 | 2 | 2016-03-10 11:09:26 | 1 | Metro |
| 1775 | 1838 | 2 | 2016-03-10 11:09:29 | 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;