Table
entry_scan
Every entrance scan; only the first of the day records how the visitor travelled.
Replaces in 2020: Entrance, Ticket.Transportation
Rows 2,351–2,375 of 9,738
| scan_idINTEGER | ticket_id→ ticket.ticket_id | entrance_id→ entrance.entrance_id | scanned_atTEXT | is_first_entryINTEGER | transport_modeTEXT |
|---|---|---|---|---|---|
| 2351 | 1949 | 1 | 2016-07-01 13:55:56 | 1 | Bus |
| 2352 | 2436 | 1 | 2016-07-01 14:07:10 | 1 | Metro |
| 2353 | 2437 | 1 | 2016-07-01 14:07:25 | 1 | Metro |
| 2354 | 2438 | 1 | 2016-07-01 14:07:35 | 1 | Metro |
| 2355 | 2397 | 2 | 2016-07-01 14:35:46 | 0 | NULL |
| 2356 | 2440 | 1 | 2016-07-01 15:08:35 | 1 | Metro |
| 2357 | 2439 | 1 | 2016-07-01 15:08:47 | 1 | Metro |
| 2358 | 2403 | 1 | 2016-07-02 10:03:20 | 1 | Bus |
| 2359 | 2402 | 1 | 2016-07-02 10:03:30 | 1 | Bus |
| 2360 | 2401 | 1 | 2016-07-02 10:03:46 | 1 | Bus |
| 2361 | 2404 | 1 | 2016-07-02 10:03:48 | 1 | Bus |
| 2362 | 2441 | 4 | 2016-07-02 10:24:14 | 1 | Private Vehicle |
| 2363 | 2442 | 4 | 2016-07-02 10:24:27 | 1 | Private Vehicle |
| 2364 | 2443 | 5 | 2016-07-02 10:45:10 | 1 | Bus |
| 2365 | 2444 | 5 | 2016-07-02 10:45:13 | 1 | Bus |
| 2366 | 2446 | 1 | 2016-07-03 15:18:58 | 1 | Walk |
| 2367 | 2452 | 1 | 2016-07-06 10:20:12 | 1 | Bus |
| 2368 | 2451 | 1 | 2016-07-06 15:29:23 | 1 | Walk |
| 2369 | 2396 | 1 | 2016-07-07 10:25:27 | 1 | Walk |
| 2370 | 2449 | 2 | 2016-07-07 11:30:50 | 1 | Metro |
| 2371 | 2422 | 3 | 2016-07-08 09:02:43 | 1 | Metro |
| 2372 | 2420 | 3 | 2016-07-08 09:02:55 | 1 | Metro |
| 2373 | 2421 | 3 | 2016-07-08 09:03:00 | 1 | Metro |
| 2374 | 2459 | 1 | 2016-07-09 09:01:04 | 1 | Walk |
| 2375 | 2458 | 1 | 2016-07-09 09:01:08 | 1 | Walk |
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;