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,251–2,275 of 9,738
| scan_idINTEGER | ticket_id→ ticket.ticket_id | entrance_id→ entrance.entrance_id | scanned_atTEXT | is_first_entryINTEGER | transport_modeTEXT |
|---|---|---|---|---|---|
| 2251 | 2239 | 1 | 2016-06-22 09:36:41 | 1 | Walk |
| 2252 | 2331 | 2 | 2016-06-23 09:28:09 | 1 | Metro |
| 2253 | 2330 | 2 | 2016-06-23 09:28:27 | 1 | Metro |
| 2254 | 2332 | 2 | 2016-06-23 09:28:41 | 1 | Metro |
| 2255 | 2333 | 2 | 2016-06-23 09:28:57 | 1 | Metro |
| 2256 | 2399 | 2 | 2016-06-23 13:35:32 | 1 | Metro |
| 2257 | 2398 | 2 | 2016-06-23 13:35:35 | 1 | Metro |
| 2258 | 2400 | 2 | 2016-06-23 13:35:52 | 1 | Metro |
| 2259 | 2375 | 1 | 2016-06-24 09:05:01 | 1 | Walk |
| 2260 | 2376 | 1 | 2016-06-24 09:05:29 | 1 | Walk |
| 2261 | 2406 | 1 | 2016-06-24 10:09:12 | 1 | Other |
| 2262 | 2349 | 2 | 2016-06-24 11:31:19 | 1 | Metro |
| 2263 | 2347 | 2 | 2016-06-24 11:31:30 | 1 | Metro |
| 2264 | 2346 | 2 | 2016-06-24 11:31:33 | 1 | Metro |
| 2265 | 2350 | 2 | 2016-06-24 11:31:39 | 1 | Metro |
| 2266 | 2348 | 2 | 2016-06-24 11:31:41 | 1 | Metro |
| 2267 | 2405 | 1 | 2016-06-24 13:17:43 | 1 | Walk |
| 2268 | 2408 | 2 | 2016-06-24 13:48:11 | 1 | Private Vehicle |
| 2269 | 2407 | 2 | 2016-06-24 13:48:25 | 1 | Private Vehicle |
| 2270 | 2409 | 1 | 2016-06-25 13:39:44 | 1 | Walk |
| 2271 | 2410 | 1 | 2016-06-25 14:11:17 | 1 | Train |
| 2272 | 2415 | 2 | 2016-06-26 12:02:31 | 1 | Bus |
| 2273 | 2416 | 2 | 2016-06-26 12:02:37 | 1 | Bus |
| 2274 | 2418 | 2 | 2016-06-26 12:02:38 | 1 | Bus |
| 2275 | 2417 | 2 | 2016-06-26 12:02: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;