Table
entry_scan
Every entrance scan; only the first of the day records how the visitor travelled.
Replaces in 2020: Entrance, Ticket.Transportation
Rows 1,476–1,500 of 9,738
| scan_idINTEGER | ticket_id→ ticket.ticket_id | entrance_id→ entrance.entrance_id | scanned_atTEXT | is_first_entryINTEGER | transport_modeTEXT |
|---|---|---|---|---|---|
| 1476 | 1572 | 2 | 2015-12-09 09:27:16 | 1 | Metro |
| 1477 | 1569 | 2 | 2015-12-09 09:27:25 | 1 | Metro |
| 1478 | 1570 | 2 | 2015-12-09 09:27:39 | 1 | Metro |
| 1479 | 1568 | 2 | 2015-12-09 09:27:41 | 1 | Metro |
| 1480 | 1573 | 2 | 2015-12-09 09:58:40 | 1 | Metro |
| 1481 | 1573 | 2 | 2015-12-09 12:55:58 | 0 | NULL |
| 1482 | 1575 | 4 | 2015-12-09 13:38:17 | 1 | Bus |
| 1483 | 1577 | 4 | 2015-12-09 13:38:44 | 1 | Bus |
| 1484 | 1576 | 4 | 2015-12-09 13:38:59 | 1 | Bus |
| 1485 | 1578 | 1 | 2015-12-11 12:30:55 | 1 | Walk |
| 1486 | 1579 | 1 | 2015-12-11 14:56:07 | 1 | Metro |
| 1487 | 1580 | 3 | 2015-12-12 09:43:35 | 1 | Walk |
| 1488 | 1581 | 4 | 2015-12-12 15:14:14 | 1 | Walk |
| 1489 | 1582 | 1 | 2015-12-13 16:22:45 | 1 | Metro |
| 1490 | 1587 | 2 | 2015-12-15 10:39:55 | 1 | Private Vehicle |
| 1491 | 1586 | 2 | 2015-12-15 10:40:06 | 1 | Private Vehicle |
| 1492 | 1588 | 2 | 2015-12-15 10:40:08 | 1 | Private Vehicle |
| 1493 | 1589 | 2 | 2015-12-15 10:40:18 | 1 | Private Vehicle |
| 1494 | 1586 | 2 | 2015-12-15 12:31:05 | 0 | NULL |
| 1495 | 1574 | 2 | 2015-12-15 12:31:50 | 1 | Metro |
| 1496 | 1587 | 2 | 2015-12-15 13:09:16 | 0 | NULL |
| 1497 | 1589 | 5 | 2015-12-15 14:11:21 | 0 | NULL |
| 1498 | 1588 | 2 | 2015-12-15 14:17:32 | 0 | NULL |
| 1499 | 1540 | 1 | 2015-12-16 15:59:44 | 1 | Walk |
| 1500 | 1591 | 4 | 2015-12-17 09:04:36 | 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;