View
museum_visit
One row per admitted ticket: the first entry of its day, with the transport answer.
Rows 7,001–7,025 of 9,383
| ticket_idINTEGER | visit_dateany | first_entry_atTEXT | entrance_idINTEGER | transport_modeTEXT |
|---|---|---|---|---|
| 7362 | 2018-12-28 | 2018-12-28 14:36:43 | 3 | Bus |
| 7363 | 2018-12-28 | 2018-12-28 14:36:06 | 3 | Bus |
| 7364 | 2018-12-29 | 2018-12-29 11:09:11 | 3 | Other |
| 7365 | 2018-12-29 | 2018-12-29 11:09:39 | 3 | Other |
| 7366 | 2019-01-03 | 2019-01-03 14:57:25 | 1 | Bus |
| 7367 | 2019-01-03 | 2019-01-03 14:57:29 | 1 | Bus |
| 7368 | 2019-01-04 | 2019-01-04 14:48:22 | 1 | Bus |
| 7369 | 2019-01-05 | 2019-01-05 09:20:54 | 1 | Walk |
| 7370 | 2019-01-05 | 2019-01-05 09:20:56 | 1 | Walk |
| 7371 | 2019-01-06 | 2019-01-06 10:11:15 | 2 | Bus |
| 7372 | 2019-01-06 | 2019-01-06 10:11:07 | 2 | Bus |
| 7373 | 2019-01-08 | 2019-01-08 15:22:23 | 1 | Metro |
| 7374 | 2019-01-08 | 2019-01-08 15:21:39 | 1 | Metro |
| 7375 | 2019-01-08 | 2019-01-08 15:21:50 | 1 | Metro |
| 7376 | 2019-01-08 | 2019-01-08 15:21:41 | 1 | Metro |
| 7377 | 2019-01-06 | 2019-01-06 12:44:43 | 1 | Metro |
| 7378 | 2019-01-06 | 2019-01-06 14:07:18 | 4 | Walk |
| 7379 | 2019-01-10 | 2019-01-10 11:01:00 | 1 | Walk |
| 7380 | 2019-01-09 | 2019-01-09 10:07:41 | 2 | Walk |
| 7381 | 2019-01-09 | 2019-01-09 10:07:26 | 2 | Walk |
| 7382 | 2019-01-12 | 2019-01-12 10:02:26 | 4 | Private Vehicle |
| 7383 | 2019-01-17 | 2019-01-17 11:52:07 | 3 | Metro |
| 7384 | 2019-01-17 | 2019-01-17 11:52:11 | 3 | Metro |
| 7385 | 2019-01-12 | 2019-01-12 10:32:05 | 3 | Other |
| 7386 | 2019-01-12 | 2019-01-12 10:54:37 | 4 | 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;