View
museum_visit
One row per admitted ticket: the first entry of its day, with the transport answer.
Rows 7,626–7,650 of 9,383
| ticket_idINTEGER | visit_dateany | first_entry_atTEXT | entrance_idINTEGER | transport_modeTEXT |
|---|---|---|---|---|
| 8026 | 2019-05-31 | 2019-05-31 11:59:00 | 1 | Bus |
| 8027 | 2019-05-31 | 2019-05-31 11:58:09 | 1 | Bus |
| 8028 | 2019-05-31 | 2019-05-31 12:01:22 | 1 | Bus |
| 8029 | 2019-05-31 | 2019-05-31 12:01:03 | 1 | Bus |
| 8030 | 2019-05-31 | 2019-05-31 12:01:15 | 1 | Bus |
| 8031 | 2019-05-31 | 2019-05-31 12:02:01 | 1 | Bus |
| 8032 | 2019-05-31 | 2019-05-31 12:02:49 | 1 | Bus |
| 8033 | 2019-05-31 | 2019-05-31 12:01:15 | 1 | Bus |
| 8034 | 2019-05-31 | 2019-05-31 12:00:12 | 1 | Bus |
| 8035 | 2019-04-08 | 2019-04-08 12:02:14 | 1 | Metro |
| 8036 | 2019-04-08 | 2019-04-08 12:02:26 | 1 | Metro |
| 8037 | 2019-04-11 | 2019-04-11 13:46:37 | 3 | Metro |
| 8038 | 2019-04-09 | 2019-04-09 12:10:32 | 2 | Private Vehicle |
| 8039 | 2019-04-09 | 2019-04-09 12:10:55 | 2 | Private Vehicle |
| 8040 | 2019-04-09 | 2019-04-09 12:11:09 | 2 | Private Vehicle |
| 8041 | 2019-04-09 | 2019-04-09 15:44:18 | 1 | Taxi |
| 8042 | 2019-04-09 | 2019-04-09 15:44:10 | 1 | Taxi |
| 8043 | 2019-04-15 | 2019-04-15 09:13:39 | 1 | Other |
| 8044 | 2019-04-15 | 2019-04-15 09:14:18 | 1 | Other |
| 8045 | 2019-04-11 | 2019-04-11 10:24:49 | 1 | Walk |
| 8046 | 2019-05-24 | 2019-05-24 13:15:39 | 4 | Walk |
| 8047 | 2019-05-24 | 2019-05-24 13:15:50 | 4 | Walk |
| 8048 | 2019-04-12 | 2019-04-12 10:16:56 | 2 | Train |
| 8049 | 2019-04-12 | 2019-04-12 10:16:58 | 2 | Train |
| 8050 | 2019-04-12 | 2019-04-12 13:24:25 | 5 | Metro |
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;