View
museum_visit
One row per admitted ticket: the first entry of its day, with the transport answer.
Rows 6,851–6,875 of 9,383
| ticket_idINTEGER | visit_dateany | first_entry_atTEXT | entrance_idINTEGER | transport_modeTEXT |
|---|---|---|---|---|
| 7196 | 2018-12-01 | 2018-12-01 11:03:16 | 5 | Private Vehicle |
| 7197 | 2018-12-01 | 2018-12-01 11:03:10 | 5 | Private Vehicle |
| 7198 | 2018-12-18 | 2018-12-18 09:43:58 | 3 | Walk |
| 7199 | 2018-11-29 | 2018-11-29 10:08:36 | 1 | Walk |
| 7200 | 2018-11-29 | 2018-11-29 10:09:11 | 1 | Walk |
| 7201 | 2018-11-29 | 2018-11-29 10:09:06 | 1 | Walk |
| 7202 | 2018-12-23 | 2018-12-23 13:36:19 | 1 | Walk |
| 7203 | 2018-11-28 | 2018-11-28 10:48:36 | 1 | Metro |
| 7205 | 2019-01-20 | 2019-01-20 09:39:41 | 1 | Other |
| 7206 | 2019-01-20 | 2019-01-20 09:39:42 | 1 | Other |
| 7207 | 2019-01-20 | 2019-01-20 09:39:45 | 1 | Other |
| 7208 | 2018-11-30 | 2018-11-30 09:19:08 | 1 | Bus |
| 7209 | 2018-11-30 | 2018-11-30 09:18:28 | 1 | Bus |
| 7210 | 2018-12-11 | 2018-12-11 13:44:09 | 1 | Walk |
| 7211 | 2018-12-11 | 2018-12-11 13:44:33 | 1 | Walk |
| 7212 | 2018-11-30 | 2018-11-30 12:41:56 | 5 | Walk |
| 7213 | 2018-11-30 | 2018-11-30 12:42:04 | 5 | Walk |
| 7214 | 2018-12-08 | 2018-12-08 13:22:00 | 1 | Metro |
| 7215 | 2018-12-05 | 2018-12-05 11:44:37 | 1 | Walk |
| 7216 | 2018-12-05 | 2018-12-05 11:44:26 | 1 | Walk |
| 7217 | 2018-12-08 | 2018-12-08 11:55:44 | 2 | Metro |
| 7218 | 2018-12-08 | 2018-12-08 11:55:13 | 2 | Metro |
| 7219 | 2018-12-02 | 2018-12-02 11:21:02 | 4 | Train |
| 7220 | 2018-12-02 | 2018-12-02 11:20:55 | 4 | Train |
| 7221 | 2018-12-02 | 2018-12-02 11:19:25 | 4 | 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;