View
museum_visit
One row per admitted ticket: the first entry of its day, with the transport answer.
Rows 7,901–7,925 of 9,383
| ticket_idINTEGER | visit_dateany | first_entry_atTEXT | entrance_idINTEGER | transport_modeTEXT |
|---|---|---|---|---|
| 8304 | 2019-06-02 | 2019-06-02 10:11:09 | 2 | Private Vehicle |
| 8305 | 2019-06-02 | 2019-06-02 10:11:05 | 2 | Private Vehicle |
| 8306 | 2019-06-06 | 2019-06-06 15:25:29 | 3 | Bus |
| 8307 | 2019-06-06 | 2019-06-06 15:25:55 | 3 | Bus |
| 8308 | 2019-06-08 | 2019-06-08 15:50:21 | 2 | Metro |
| 8309 | 2019-06-08 | 2019-06-08 15:50:30 | 2 | Metro |
| 8310 | 2019-06-14 | 2019-06-14 15:46:50 | 4 | Walk |
| 8311 | 2019-06-14 | 2019-06-14 15:46:27 | 4 | Walk |
| 8312 | 2019-06-17 | 2019-06-17 13:38:34 | 1 | Taxi |
| 8313 | 2019-06-11 | 2019-06-11 12:29:09 | 1 | Walk |
| 8314 | 2019-06-11 | 2019-06-11 12:29:06 | 1 | Walk |
| 8315 | 2019-06-04 | 2019-06-04 11:45:29 | 4 | Walk |
| 8316 | 2019-06-04 | 2019-06-04 11:45:22 | 4 | Walk |
| 8317 | 2019-06-08 | 2019-06-08 10:36:28 | 2 | Walk |
| 8318 | 2019-06-08 | 2019-06-08 10:36:19 | 2 | Walk |
| 8319 | 2019-06-04 | 2019-06-04 11:26:46 | 1 | Taxi |
| 8320 | 2019-06-05 | 2019-06-05 12:09:16 | 1 | Walk |
| 8321 | 2019-06-05 | 2019-06-05 12:09:26 | 1 | Walk |
| 8322 | 2019-06-10 | 2019-06-10 12:38:09 | 5 | Bus |
| 8323 | 2019-06-10 | 2019-06-10 12:37:39 | 5 | Bus |
| 8324 | 2019-06-12 | 2019-06-12 10:29:22 | 1 | Taxi |
| 8325 | 2019-06-17 | 2019-06-17 09:42:56 | 2 | Metro |
| 8327 | 2019-06-29 | 2019-06-29 10:42:52 | 1 | Walk |
| 8328 | 2019-06-29 | 2019-06-29 10:42:19 | 1 | Walk |
| 8329 | 2019-06-08 | 2019-06-08 10:44:14 | 1 | Walk |
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;