Table
entry_scan
Every entrance scan; only the first of the day records how the visitor travelled.
Replaces in 2020: Entrance, Ticket.Transportation
Rows 8,426–8,450 of 9,738
| scan_idINTEGER | ticket_id→ ticket.ticket_id | entrance_id→ entrance.entrance_id | scanned_atTEXT | is_first_entryINTEGER | transport_modeTEXT |
|---|---|---|---|---|---|
| 8426 | 8561 | 3 | 2019-07-20 13:50:24 | 1 | Metro |
| 8427 | 8564 | 3 | 2019-07-20 13:50:36 | 1 | Metro |
| 8428 | 8583 | 2 | 2019-07-20 14:48:44 | 1 | Train |
| 8429 | 8584 | 2 | 2019-07-20 14:48:48 | 1 | Train |
| 8430 | 8582 | 3 | 2019-07-20 14:48:49 | 1 | Metro |
| 8431 | 8515 | 2 | 2019-07-20 16:09:14 | 1 | Walk |
| 8432 | 8516 | 2 | 2019-07-20 16:09:17 | 1 | Walk |
| 8433 | 8589 | 1 | 2019-07-22 13:37:15 | 1 | Taxi |
| 8434 | 8588 | 1 | 2019-07-22 13:37:35 | 1 | Taxi |
| 8435 | 8595 | 2 | 2019-07-23 10:55:01 | 1 | Walk |
| 8436 | 8596 | 2 | 2019-07-23 10:55:26 | 1 | Walk |
| 8437 | 8551 | 2 | 2019-07-24 10:28:17 | 1 | Private Vehicle |
| 8438 | 8550 | 2 | 2019-07-24 10:28:19 | 1 | Private Vehicle |
| 8439 | 8585 | 1 | 2019-07-24 11:44:27 | 1 | Train |
| 8440 | 8631 | 1 | 2019-07-24 12:07:52 | 1 | Walk |
| 8441 | 8635 | 1 | 2019-07-24 14:43:17 | 1 | Train |
| 8442 | 8597 | 2 | 2019-07-24 15:40:52 | 1 | Bus |
| 8443 | 8636 | 1 | 2019-07-25 10:01:34 | 1 | Metro |
| 8444 | 8463 | 1 | 2019-07-25 12:18:08 | 1 | Metro |
| 8445 | 8464 | 1 | 2019-07-25 12:18:17 | 1 | Metro |
| 8446 | 8465 | 1 | 2019-07-25 12:18:26 | 1 | Metro |
| 8447 | 8466 | 1 | 2019-07-25 12:18:35 | 1 | Metro |
| 8448 | 8467 | 1 | 2019-07-25 12:18:48 | 1 | Metro |
| 8449 | 8471 | 1 | 2019-07-25 12:18:48 | 1 | Metro |
| 8450 | 8472 | 1 | 2019-07-25 12:18:53 | 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;