Table
entry_scan
Every entrance scan; only the first of the day records how the visitor travelled.
Replaces in 2020: Entrance, Ticket.Transportation
Rows 426–450 of 9,738
| scan_idINTEGER | ticket_id→ ticket.ticket_id | entrance_id→ entrance.entrance_id | scanned_atTEXT | is_first_entryINTEGER | transport_modeTEXT |
|---|---|---|---|---|---|
| 426 | 634 | 4 | 2015-06-06 10:21:32 | 1 | Walk |
| 427 | 637 | 3 | 2015-06-06 11:11:42 | 1 | Metro |
| 428 | 633 | 4 | 2015-06-06 12:22:03 | 0 | NULL |
| 429 | 638 | 2 | 2015-06-06 13:29:31 | 1 | Metro |
| 430 | 514 | 4 | 2015-06-06 13:52:54 | 1 | Metro |
| 431 | 517 | 4 | 2015-06-06 13:52:59 | 1 | Metro |
| 432 | 516 | 4 | 2015-06-06 13:53:00 | 1 | Metro |
| 433 | 515 | 4 | 2015-06-06 13:53:08 | 1 | Metro |
| 434 | 634 | 4 | 2015-06-06 14:12:44 | 0 | NULL |
| 435 | 639 | 1 | 2015-06-06 15:47:00 | 1 | Walk |
| 436 | 607 | 1 | 2015-06-07 14:04:15 | 1 | Bus |
| 437 | 643 | 2 | 2015-06-08 10:47:46 | 1 | Metro |
| 438 | 645 | 2 | 2015-06-08 10:47:46 | 1 | Metro |
| 439 | 646 | 2 | 2015-06-08 10:47:48 | 1 | Metro |
| 440 | 644 | 2 | 2015-06-08 10:48:03 | 1 | Metro |
| 441 | 641 | 2 | 2015-06-08 10:49:30 | 1 | Metro |
| 442 | 642 | 2 | 2015-06-08 10:49:35 | 1 | Metro |
| 443 | 640 | 2 | 2015-06-08 10:49:44 | 1 | Metro |
| 444 | 648 | 1 | 2015-06-08 11:22:32 | 1 | Metro |
| 445 | 647 | 1 | 2015-06-08 11:22:40 | 1 | Metro |
| 446 | 649 | 2 | 2015-06-08 14:57:46 | 1 | Private Vehicle |
| 447 | 636 | 2 | 2015-06-09 09:21:54 | 1 | Metro |
| 448 | 635 | 2 | 2015-06-09 09:22:00 | 1 | Metro |
| 449 | 625 | 4 | 2015-06-10 15:01:40 | 1 | Bus |
| 450 | 624 | 4 | 2015-06-10 15:01:46 | 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;