Table
entry_scan
Every entrance scan; only the first of the day records how the visitor travelled.
Replaces in 2020: Entrance, Ticket.Transportation
Rows 6,601–6,625 of 9,738
| scan_idINTEGER | ticket_id→ ticket.ticket_id | entrance_id→ entrance.entrance_id | scanned_atTEXT | is_first_entryINTEGER | transport_modeTEXT |
|---|---|---|---|---|---|
| 6601 | 6848 | 2 | 2018-10-09 12:40:18 | 1 | Other |
| 6602 | 6846 | 2 | 2018-10-09 12:40:25 | 1 | Other |
| 6603 | 6844 | 2 | 2018-10-09 12:40:47 | 1 | Other |
| 6604 | 6847 | 2 | 2018-10-09 12:40:57 | 1 | Other |
| 6605 | 6845 | 2 | 2018-10-09 12:41:00 | 1 | Other |
| 6606 | 6868 | 1 | 2018-10-09 12:44:08 | 1 | Metro |
| 6607 | 6867 | 1 | 2018-10-09 12:44:10 | 1 | Metro |
| 6608 | 6866 | 1 | 2018-10-09 12:44:48 | 1 | Metro |
| 6609 | 6702 | 4 | 2018-10-09 15:08:51 | 1 | Metro |
| 6610 | 6703 | 4 | 2018-10-09 15:08:59 | 1 | Metro |
| 6611 | 6773 | 2 | 2018-10-10 13:16:25 | 1 | Private Vehicle |
| 6612 | 6772 | 2 | 2018-10-10 13:17:03 | 1 | Private Vehicle |
| 6613 | 6788 | 2 | 2018-10-10 16:41:54 | 1 | Metro |
| 6614 | 6789 | 2 | 2018-10-10 16:41:55 | 1 | Metro |
| 6615 | 6869 | 1 | 2018-10-11 10:56:35 | 1 | Metro |
| 6616 | 6507 | 1 | 2018-10-11 11:37:25 | 1 | Walk |
| 6617 | 6508 | 1 | 2018-10-11 11:37:28 | 1 | Walk |
| 6618 | 6871 | 1 | 2018-10-11 11:43:32 | 1 | Metro |
| 6619 | 6870 | 1 | 2018-10-11 11:43:45 | 1 | Metro |
| 6620 | 6854 | 2 | 2018-10-11 13:30:52 | 1 | Other |
| 6621 | 6872 | 3 | 2018-10-12 09:31:38 | 1 | Walk |
| 6622 | 6857 | 1 | 2018-10-13 12:08:44 | 1 | Walk |
| 6623 | 6856 | 1 | 2018-10-13 12:09:04 | 1 | Walk |
| 6624 | 6874 | 2 | 2018-10-13 12:24:50 | 1 | Metro |
| 6625 | 6876 | 2 | 2018-10-13 12:24:50 | 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;