Table
entry_scan
Every entrance scan; only the first of the day records how the visitor travelled.
Replaces in 2020: Entrance, Ticket.Transportation
Rows 251–275 of 9,738
| scan_idINTEGER | ticket_id→ ticket.ticket_id | entrance_id→ entrance.entrance_id | scanned_atTEXT | is_first_entryINTEGER | transport_modeTEXT |
|---|---|---|---|---|---|
| 251 | 421 | 1 | 2015-05-01 11:30:33 | 1 | Other |
| 252 | 356 | 2 | 2015-05-01 11:46:00 | 1 | Walk |
| 253 | 357 | 2 | 2015-05-01 11:46:15 | 1 | Walk |
| 254 | 308 | 1 | 2015-05-01 13:28:33 | 1 | Metro |
| 255 | 309 | 1 | 2015-05-01 13:29:15 | 1 | Metro |
| 256 | 422 | 3 | 2015-05-01 15:42:18 | 1 | Metro |
| 257 | 336 | 1 | 2015-05-02 11:22:06 | 1 | Taxi |
| 258 | 338 | 1 | 2015-05-02 11:22:06 | 1 | Taxi |
| 259 | 337 | 1 | 2015-05-02 11:22:08 | 1 | Taxi |
| 260 | 424 | 5 | 2015-05-02 14:25:23 | 1 | Other |
| 261 | 423 | 5 | 2015-05-02 14:25:42 | 1 | Other |
| 262 | 427 | 1 | 2015-05-03 10:00:24 | 1 | Walk |
| 263 | 426 | 1 | 2015-05-03 10:00:50 | 1 | Walk |
| 264 | 425 | 1 | 2015-05-03 10:06:41 | 1 | Metro |
| 265 | 333 | 4 | 2015-05-03 10:07:54 | 1 | Walk |
| 266 | 332 | 4 | 2015-05-03 10:07:59 | 1 | Walk |
| 267 | 334 | 4 | 2015-05-03 10:08:02 | 1 | Walk |
| 268 | 335 | 4 | 2015-05-03 10:08:21 | 1 | Walk |
| 269 | 431 | 2 | 2015-05-03 14:01:26 | 1 | Private Vehicle |
| 270 | 428 | 2 | 2015-05-03 14:01:27 | 1 | Private Vehicle |
| 271 | 429 | 2 | 2015-05-03 14:01:28 | 1 | Private Vehicle |
| 272 | 430 | 2 | 2015-05-03 14:01:33 | 1 | Private Vehicle |
| 273 | 430 | 2 | 2015-05-03 16:24:51 | 0 | NULL |
| 274 | 428 | 5 | 2015-05-03 17:03:45 | 0 | NULL |
| 275 | 429 | 2 | 2015-05-03 17:21:59 | 0 | NULL |
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;