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,226–4,250 of 9,738
| scan_idINTEGER | ticket_id→ ticket.ticket_id | entrance_id→ entrance.entrance_id | scanned_atTEXT | is_first_entryINTEGER | transport_modeTEXT |
|---|---|---|---|---|---|
| 4226 | 4404 | 1 | 2017-08-17 11:37:13 | 1 | Walk |
| 4227 | 4406 | 1 | 2017-08-17 11:37:28 | 1 | Walk |
| 4228 | 4405 | 1 | 2017-08-17 11:37:30 | 1 | Walk |
| 4229 | 4403 | 1 | 2017-08-17 11:37:43 | 1 | Walk |
| 4230 | 4314 | 1 | 2017-08-17 12:50:44 | 1 | Metro |
| 4231 | 4315 | 1 | 2017-08-17 12:51:10 | 1 | Metro |
| 4232 | 4407 | 2 | 2017-08-17 14:06:34 | 1 | Metro |
| 4233 | 4407 | 1 | 2017-08-17 15:47:38 | 0 | NULL |
| 4234 | 4409 | 2 | 2017-08-18 12:18:31 | 1 | Metro |
| 4235 | 4410 | 2 | 2017-08-18 12:18:31 | 1 | Metro |
| 4236 | 4409 | 2 | 2017-08-18 15:12:24 | 0 | NULL |
| 4237 | 4410 | 2 | 2017-08-18 16:12:18 | 0 | NULL |
| 4238 | 4363 | 1 | 2017-08-19 09:28:31 | 1 | Bus |
| 4239 | 4364 | 1 | 2017-08-19 09:28:53 | 1 | Bus |
| 4240 | 4391 | 2 | 2017-08-19 09:55:52 | 1 | Bus |
| 4241 | 4392 | 2 | 2017-08-19 09:55:56 | 1 | Bus |
| 4242 | 4379 | 1 | 2017-08-19 12:06:13 | 1 | Other |
| 4243 | 4380 | 1 | 2017-08-19 12:06:29 | 1 | Other |
| 4244 | 4416 | 4 | 2017-08-19 14:01:57 | 1 | Walk |
| 4245 | 4415 | 4 | 2017-08-19 14:02:11 | 1 | Walk |
| 4246 | 4372 | 2 | 2017-08-20 12:20:57 | 1 | Private Vehicle |
| 4247 | 4370 | 2 | 2017-08-20 12:21:17 | 1 | Private Vehicle |
| 4248 | 4373 | 2 | 2017-08-20 12:21:21 | 1 | Private Vehicle |
| 4249 | 4369 | 2 | 2017-08-20 12:21:32 | 1 | Private Vehicle |
| 4250 | 4371 | 2 | 2017-08-20 12:21:32 | 1 | Private Vehicle |
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;