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,276–2,300 of 9,738
| scan_idINTEGER | ticket_id→ ticket.ticket_id | entrance_id→ entrance.entrance_id | scanned_atTEXT | is_first_entryINTEGER | transport_modeTEXT |
|---|---|---|---|---|---|
| 2276 | 2419 | 2 | 2016-06-26 12:03:00 | 1 | Bus |
| 2277 | 2411 | 2 | 2016-06-27 12:05:57 | 1 | Private Vehicle |
| 2278 | 2414 | 2 | 2016-06-27 12:06:28 | 1 | Private Vehicle |
| 2279 | 2412 | 2 | 2016-06-27 12:06:29 | 1 | Private Vehicle |
| 2280 | 2413 | 2 | 2016-06-27 12:06:34 | 1 | Private Vehicle |
| 2281 | 2386 | 1 | 2016-06-28 12:57:33 | 1 | Metro |
| 2282 | 2363 | 1 | 2016-06-29 10:04:13 | 1 | Metro |
| 2283 | 2363 | 1 | 2016-06-29 11:47:40 | 0 | NULL |
| 2284 | 2423 | 3 | 2016-06-29 13:14:35 | 1 | Taxi |
| 2285 | 2390 | 2 | 2016-06-29 14:11:39 | 1 | Walk |
| 2286 | 2431 | 2 | 2016-06-30 13:47:32 | 1 | Metro |
| 2287 | 2430 | 2 | 2016-06-30 13:47:35 | 1 | Metro |
| 2288 | 2429 | 2 | 2016-06-30 13:47:50 | 1 | Metro |
| 2289 | 2432 | 1 | 2016-07-01 12:04:59 | 1 | Bus |
| 2290 | 2433 | 1 | 2016-07-01 12:05:37 | 1 | Bus |
| 2291 | 2434 | 1 | 2016-07-01 12:05:40 | 1 | Bus |
| 2292 | 2435 | 1 | 2016-07-01 12:05:41 | 1 | Bus |
| 2293 | 2397 | 2 | 2016-07-01 12:58:24 | 1 | Metro |
| 2294 | 1892 | 1 | 2016-07-01 13:42:38 | 1 | Bus |
| 2295 | 1893 | 1 | 2016-07-01 13:42:44 | 1 | Bus |
| 2296 | 1894 | 1 | 2016-07-01 13:42:58 | 1 | Bus |
| 2297 | 1900 | 1 | 2016-07-01 13:43:10 | 1 | Bus |
| 2298 | 1896 | 1 | 2016-07-01 13:43:18 | 1 | Bus |
| 2299 | 1902 | 1 | 2016-07-01 13:43:18 | 1 | Bus |
| 2300 | 1895 | 1 | 2016-07-01 13:43:20 | 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;