Table
entry_scan
Every entrance scan; only the first of the day records how the visitor travelled.
Replaces in 2020: Entrance, Ticket.Transportation
Rows 4,026–4,050 of 9,738
| scan_idINTEGER | ticket_id→ ticket.ticket_id | entrance_id→ entrance.entrance_id | scanned_atTEXT | is_first_entryINTEGER | transport_modeTEXT |
|---|---|---|---|---|---|
| 4026 | 3680 | 4 | 2017-07-02 10:04:19 | 1 | Bus |
| 4027 | 3672 | 4 | 2017-07-02 10:04:23 | 1 | Bus |
| 4028 | 3669 | 4 | 2017-07-02 10:04:34 | 1 | Bus |
| 4029 | 3671 | 4 | 2017-07-02 10:04:37 | 1 | Bus |
| 4030 | 3670 | 4 | 2017-07-02 10:04:49 | 1 | Bus |
| 4031 | 3677 | 4 | 2017-07-02 10:04:55 | 1 | Bus |
| 4032 | 4166 | 1 | 2017-07-03 11:06:58 | 1 | Bus |
| 4033 | 4165 | 1 | 2017-07-03 11:07:02 | 1 | Bus |
| 4034 | 4073 | 5 | 2017-07-03 11:59:25 | 1 | Walk |
| 4035 | 4074 | 5 | 2017-07-03 11:59:44 | 1 | Walk |
| 4036 | 4167 | 4 | 2017-07-04 11:44:06 | 1 | Metro |
| 4037 | 4168 | 1 | 2017-07-04 14:27:41 | 1 | Walk |
| 4038 | 4058 | 4 | 2017-07-05 09:47:05 | 1 | Metro |
| 4039 | 4145 | 2 | 2017-07-05 10:38:48 | 1 | Metro |
| 4040 | 4147 | 2 | 2017-07-05 10:38:54 | 1 | Metro |
| 4041 | 4144 | 2 | 2017-07-05 10:38:56 | 1 | Metro |
| 4042 | 4146 | 2 | 2017-07-05 10:39:04 | 1 | Metro |
| 4043 | 4174 | 2 | 2017-07-05 11:10:19 | 1 | Private Vehicle |
| 4044 | 4169 | 2 | 2017-07-05 11:57:54 | 1 | Metro |
| 4045 | 4170 | 2 | 2017-07-05 11:58:37 | 1 | Metro |
| 4046 | 4058 | 4 | 2017-07-05 13:22:09 | 0 | NULL |
| 4047 | 4175 | 3 | 2017-07-05 13:58:43 | 1 | Metro |
| 4048 | 4148 | 2 | 2017-07-06 09:05:14 | 1 | Taxi |
| 4049 | 4149 | 2 | 2017-07-06 09:05:16 | 1 | Taxi |
| 4050 | 4141 | 4 | 2017-07-06 15:08:52 | 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;