Table
entry_scan
Every entrance scan; only the first of the day records how the visitor travelled.
Replaces in 2020: Entrance, Ticket.Transportation
Rows 926–950 of 9,738
| scan_idINTEGER | ticket_id→ ticket.ticket_id | entrance_id→ entrance.entrance_id | scanned_atTEXT | is_first_entryINTEGER | transport_modeTEXT |
|---|---|---|---|---|---|
| 926 | 1058 | 2 | 2015-08-31 11:25:44 | 1 | Bus |
| 927 | 1013 | 1 | 2015-09-01 10:47:53 | 1 | Metro |
| 928 | 1014 | 1 | 2015-09-01 10:48:26 | 1 | Metro |
| 929 | 1011 | 1 | 2015-09-01 10:48:29 | 1 | Metro |
| 930 | 1012 | 1 | 2015-09-01 10:48:37 | 1 | Metro |
| 931 | 1064 | 2 | 2015-09-01 12:03:31 | 1 | Walk |
| 932 | 1044 | 2 | 2015-09-01 14:18:46 | 1 | Metro |
| 933 | 452 | 1 | 2015-09-02 12:07:19 | 1 | Bus |
| 934 | 453 | 1 | 2015-09-02 12:07:33 | 1 | Bus |
| 935 | 455 | 1 | 2015-09-02 12:07:37 | 1 | Bus |
| 936 | 456 | 1 | 2015-09-02 12:07:39 | 1 | Bus |
| 937 | 454 | 1 | 2015-09-02 12:07:45 | 1 | Bus |
| 938 | 459 | 1 | 2015-09-02 12:07:55 | 1 | Bus |
| 939 | 464 | 1 | 2015-09-02 12:08:09 | 1 | Bus |
| 940 | 470 | 1 | 2015-09-02 12:08:23 | 1 | Bus |
| 941 | 458 | 1 | 2015-09-02 12:08:24 | 1 | Bus |
| 942 | 471 | 1 | 2015-09-02 12:08:27 | 1 | Bus |
| 943 | 461 | 1 | 2015-09-02 12:08:31 | 1 | Bus |
| 944 | 465 | 1 | 2015-09-02 12:08:47 | 1 | Bus |
| 945 | 463 | 1 | 2015-09-02 12:08:49 | 1 | Bus |
| 946 | 460 | 1 | 2015-09-02 12:08:57 | 1 | Bus |
| 947 | 483 | 1 | 2015-09-02 12:08:59 | 1 | Bus |
| 948 | 469 | 1 | 2015-09-02 12:09:34 | 1 | Bus |
| 949 | 468 | 1 | 2015-09-02 12:09:39 | 1 | Bus |
| 950 | 472 | 1 | 2015-09-02 12:09:43 | 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;