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,951–2,975 of 9,738
| scan_idINTEGER | ticket_id→ ticket.ticket_id | entrance_id→ entrance.entrance_id | scanned_atTEXT | is_first_entryINTEGER | transport_modeTEXT |
|---|---|---|---|---|---|
| 2951 | 3059 | 1 | 2016-11-25 14:44:58 | 1 | Bus |
| 2952 | 2948 | 1 | 2016-11-26 10:56:12 | 1 | Bus |
| 2953 | 2949 | 1 | 2016-11-26 10:56:13 | 1 | Bus |
| 2954 | 2946 | 1 | 2016-11-26 10:56:14 | 1 | Bus |
| 2955 | 2947 | 1 | 2016-11-26 10:56:33 | 1 | Bus |
| 2956 | 3064 | 1 | 2016-11-27 09:31:07 | 1 | Taxi |
| 2957 | 3065 | 1 | 2016-11-27 09:31:07 | 1 | Taxi |
| 2958 | 3066 | 1 | 2016-11-27 09:31:15 | 1 | Taxi |
| 2959 | 3063 | 1 | 2016-11-27 09:31:30 | 1 | Taxi |
| 2960 | 3062 | 1 | 2016-11-27 11:42:07 | 1 | Metro |
| 2961 | 3061 | 1 | 2016-11-27 11:42:17 | 1 | Metro |
| 2962 | 3056 | 2 | 2016-11-27 15:36:02 | 1 | Private Vehicle |
| 2963 | 3055 | 2 | 2016-11-27 15:36:07 | 1 | Private Vehicle |
| 2964 | 3058 | 2 | 2016-11-27 15:36:09 | 1 | Private Vehicle |
| 2965 | 3057 | 2 | 2016-11-27 15:36:16 | 1 | Private Vehicle |
| 2966 | 3068 | 1 | 2016-11-29 10:21:28 | 1 | Bus |
| 2967 | 3074 | 1 | 2016-11-30 16:31:40 | 1 | Walk |
| 2968 | 3073 | 1 | 2016-11-30 16:31:44 | 1 | Walk |
| 2969 | 3048 | 4 | 2016-12-01 10:14:53 | 1 | Metro |
| 2970 | 3067 | 2 | 2016-12-02 13:32:38 | 1 | Private Vehicle |
| 2971 | 3067 | 1 | 2016-12-02 16:37:26 | 0 | NULL |
| 2972 | 3137 | 1 | 2016-12-03 11:53:57 | 1 | Walk |
| 2973 | 3144 | 5 | 2016-12-04 13:55:43 | 1 | Walk |
| 2974 | 3150 | 1 | 2016-12-07 10:20:00 | 1 | Private Vehicle |
| 2975 | 3075 | 2 | 2016-12-07 10:45:34 | 1 | Metro |
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;