View
museum_visit
One row per admitted ticket: the first entry of its day, with the transport answer.
Rows 3,001–3,025 of 9,383
| ticket_idINTEGER | visit_dateany | first_entry_atTEXT | entrance_idINTEGER | transport_modeTEXT |
|---|---|---|---|---|
| 3159 | 2016-12-13 | 2016-12-13 14:35:01 | 2 | Bus |
| 3160 | 2016-12-13 | 2016-12-13 14:34:59 | 2 | Bus |
| 3161 | 2016-12-15 | 2016-12-15 09:22:45 | 1 | Walk |
| 3162 | 2016-12-15 | 2016-12-15 09:23:00 | 1 | Walk |
| 3163 | 2016-12-15 | 2016-12-15 09:23:00 | 1 | Walk |
| 3164 | 2016-12-11 | 2016-12-11 13:47:19 | 4 | Metro |
| 3165 | 2016-12-11 | 2016-12-11 13:47:23 | 4 | Metro |
| 3166 | 2016-12-11 | 2016-12-11 14:18:09 | 3 | Bus |
| 3167 | 2016-12-12 | 2016-12-12 16:48:03 | 1 | Walk |
| 3168 | 2016-12-13 | 2016-12-13 16:31:58 | 4 | Bus |
| 3169 | 2016-12-13 | 2016-12-13 16:31:44 | 4 | Bus |
| 3170 | 2016-12-13 | 2016-12-13 16:32:07 | 4 | Bus |
| 3171 | 2016-12-13 | 2016-12-13 16:32:14 | 4 | Bus |
| 3172 | 2016-12-14 | 2016-12-14 10:39:59 | 2 | Metro |
| 3173 | 2016-12-14 | 2016-12-14 10:39:49 | 2 | Metro |
| 3174 | 2016-12-21 | 2016-12-21 11:47:25 | 1 | Train |
| 3175 | 2016-12-21 | 2016-12-21 11:47:33 | 1 | Train |
| 3176 | 2016-12-21 | 2016-12-21 11:47:24 | 1 | Train |
| 3177 | 2016-12-15 | 2016-12-15 09:01:29 | 1 | Metro |
| 3178 | 2016-12-15 | 2016-12-15 09:01:47 | 1 | Metro |
| 3179 | 2016-12-15 | 2016-12-15 15:42:09 | 1 | Walk |
| 3182 | 2016-12-16 | 2016-12-16 14:38:46 | 1 | Walk |
| 3183 | 2016-12-18 | 2016-12-18 11:45:24 | 1 | Bus |
| 3184 | 2016-12-18 | 2016-12-18 11:45:58 | 1 | Bus |
| 3185 | 2016-12-18 | 2016-12-18 11:45:48 | 1 | Bus |
View definition
CREATE VIEW museum_visit AS
SELECT
e.ticket_id,
date(e.scanned_at) AS visit_date,
e.scanned_at AS first_entry_at,
e.entrance_id,
e.transport_mode
FROM entry_scan e
WHERE e.is_first_entry = 1;