Table
entry_scan
Every entrance scan; only the first of the day records how the visitor travelled.
Replaces in 2020: Entrance, Ticket.Transportation
Rows 4,201–4,225 of 9,738
| scan_idINTEGER | ticket_id→ ticket.ticket_id | entrance_id→ entrance.entrance_id | scanned_atTEXT | is_first_entryINTEGER | transport_modeTEXT |
|---|---|---|---|---|---|
| 4201 | 4376 | 2 | 2017-08-12 11:04:48 | 1 | Metro |
| 4202 | 4300 | 2 | 2017-08-12 11:46:17 | 1 | Private Vehicle |
| 4203 | 4339 | 1 | 2017-08-13 10:32:31 | 1 | Metro |
| 4204 | 4338 | 1 | 2017-08-13 10:32:35 | 1 | Metro |
| 4205 | 4340 | 1 | 2017-08-13 10:32:48 | 1 | Metro |
| 4206 | 4374 | 2 | 2017-08-13 11:29:26 | 1 | Metro |
| 4207 | 4374 | 2 | 2017-08-13 13:19:56 | 0 | NULL |
| 4208 | 4342 | 1 | 2017-08-13 13:40:58 | 1 | Metro |
| 4209 | 4341 | 1 | 2017-08-13 13:41:31 | 1 | Metro |
| 4210 | 4381 | 1 | 2017-08-13 16:47:27 | 1 | Bus |
| 4211 | 4384 | 1 | 2017-08-14 09:24:51 | 1 | Other |
| 4212 | 4382 | 1 | 2017-08-14 09:26:27 | 1 | Metro |
| 4213 | 4383 | 1 | 2017-08-14 09:26:44 | 1 | Metro |
| 4214 | 4385 | 3 | 2017-08-14 13:13:30 | 1 | Metro |
| 4215 | 4386 | 2 | 2017-08-14 14:33:43 | 1 | Metro |
| 4216 | 4388 | 2 | 2017-08-14 14:34:04 | 1 | Metro |
| 4217 | 4389 | 2 | 2017-08-14 14:34:12 | 1 | Metro |
| 4218 | 4387 | 2 | 2017-08-14 14:34:13 | 1 | Metro |
| 4219 | 4395 | 2 | 2017-08-15 09:53:08 | 1 | Bus |
| 4220 | 4394 | 2 | 2017-08-15 09:53:25 | 1 | Bus |
| 4221 | 4345 | 3 | 2017-08-16 09:23:04 | 1 | Walk |
| 4222 | 4344 | 3 | 2017-08-16 09:23:29 | 1 | Walk |
| 4223 | 4400 | 1 | 2017-08-16 09:25:56 | 1 | Metro |
| 4224 | 4400 | 1 | 2017-08-16 12:38:58 | 0 | NULL |
| 4225 | 4308 | 3 | 2017-08-16 14:36:21 | 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;