View
museum_visit
One row per admitted ticket: the first entry of its day, with the transport answer.
Rows 8,676–8,700 of 9,383
| ticket_idINTEGER | visit_dateany | first_entry_atTEXT | entrance_idINTEGER | transport_modeTEXT |
|---|---|---|---|---|
| 9114 | 2019-10-14 | 2019-10-14 10:36:17 | 3 | Metro |
| 9115 | 2019-09-26 | 2019-09-26 12:52:51 | 1 | Taxi |
| 9116 | 2019-10-05 | 2019-10-05 09:49:49 | 2 | Metro |
| 9117 | 2019-09-28 | 2019-09-28 09:48:13 | 1 | Metro |
| 9118 | 2019-09-28 | 2019-09-28 09:48:22 | 1 | Metro |
| 9119 | 2019-09-29 | 2019-09-29 09:08:53 | 2 | Metro |
| 9120 | 2019-09-29 | 2019-09-29 09:08:44 | 2 | Metro |
| 9121 | 2019-10-28 | 2019-10-28 14:26:47 | 4 | Walk |
| 9122 | 2019-10-03 | 2019-10-03 09:10:01 | 2 | Metro |
| 9123 | 2019-10-03 | 2019-10-03 09:09:49 | 2 | Metro |
| 9124 | 2019-10-03 | 2019-10-03 09:10:14 | 2 | Metro |
| 9125 | 2019-10-03 | 2019-10-03 09:09:50 | 2 | Metro |
| 9126 | 2019-10-11 | 2019-10-11 14:27:56 | 3 | Walk |
| 9127 | 2019-10-11 | 2019-10-11 14:27:49 | 3 | Walk |
| 9128 | 2019-10-17 | 2019-10-17 10:56:30 | 1 | Bus |
| 9129 | 2019-10-17 | 2019-10-17 10:55:53 | 1 | Bus |
| 9130 | 2019-10-17 | 2019-10-17 10:56:01 | 1 | Bus |
| 9131 | 2019-10-05 | 2019-10-05 13:48:36 | 4 | Train |
| 9132 | 2019-10-05 | 2019-10-05 13:49:07 | 4 | Train |
| 9133 | 2019-10-03 | 2019-10-03 10:58:34 | 1 | Bus |
| 9134 | 2019-10-03 | 2019-10-03 10:58:00 | 1 | Bus |
| 9135 | 2019-10-13 | 2019-10-13 14:59:23 | 3 | Bus |
| 9136 | 2019-10-13 | 2019-10-13 14:59:17 | 3 | Bus |
| 9137 | 2019-10-13 | 2019-10-13 14:59:08 | 3 | Bus |
| 9138 | 2019-10-16 | 2019-10-16 11:00:50 | 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;