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,326–4,350 of 9,738
| scan_idINTEGER | ticket_id→ ticket.ticket_id | entrance_id→ entrance.entrance_id | scanned_atTEXT | is_first_entryINTEGER | transport_modeTEXT |
|---|---|---|---|---|---|
| 4326 | 4398 | 4 | 2017-09-01 10:21:50 | 1 | Metro |
| 4327 | 4524 | 1 | 2017-09-01 11:59:09 | 1 | Walk |
| 4328 | 4378 | 4 | 2017-09-01 15:52:24 | 1 | Metro |
| 4329 | 4521 | 4 | 2017-09-02 15:07:45 | 1 | Metro |
| 4330 | 4522 | 4 | 2017-09-02 15:08:03 | 1 | Metro |
| 4331 | 4483 | 5 | 2017-09-03 09:27:19 | 1 | Walk |
| 4332 | 4484 | 5 | 2017-09-03 09:27:30 | 1 | Walk |
| 4333 | 4534 | 1 | 2017-09-03 11:19:09 | 1 | Private Vehicle |
| 4334 | 4535 | 1 | 2017-09-03 11:19:12 | 1 | Private Vehicle |
| 4335 | 4536 | 1 | 2017-09-03 11:19:16 | 1 | Private Vehicle |
| 4336 | 4514 | 1 | 2017-09-04 11:33:23 | 1 | Metro |
| 4337 | 4512 | 1 | 2017-09-04 11:33:45 | 1 | Metro |
| 4338 | 4513 | 1 | 2017-09-04 11:33:47 | 1 | Metro |
| 4339 | 4544 | 2 | 2017-09-04 16:24:12 | 1 | Other |
| 4340 | 4542 | 2 | 2017-09-04 16:24:19 | 1 | Other |
| 4341 | 4543 | 2 | 2017-09-04 16:24:39 | 1 | Other |
| 4342 | 4467 | 1 | 2017-09-05 09:28:39 | 1 | Train |
| 4343 | 4468 | 1 | 2017-09-05 09:29:01 | 1 | Train |
| 4344 | 4502 | 2 | 2017-09-05 13:49:56 | 1 | Metro |
| 4345 | 4549 | 3 | 2017-09-06 11:38:58 | 1 | Walk |
| 4346 | 4551 | 3 | 2017-09-06 13:40:12 | 1 | Metro |
| 4347 | 4550 | 3 | 2017-09-06 13:40:23 | 1 | Metro |
| 4348 | 4552 | 3 | 2017-09-06 13:40:32 | 1 | Metro |
| 4349 | 4540 | 2 | 2017-09-06 14:35:39 | 1 | Bus |
| 4350 | 4541 | 2 | 2017-09-06 14:35:47 | 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;