View
museum_visit
One row per admitted ticket: the first entry of its day, with the transport answer.
Rows 9,051–9,075 of 9,383
| ticket_idINTEGER | visit_dateany | first_entry_atTEXT | entrance_idINTEGER | transport_modeTEXT |
|---|---|---|---|---|
| 9499 | 2019-12-05 | 2019-12-05 09:40:46 | 2 | Metro |
| 9500 | 2019-12-05 | 2019-12-05 09:41:10 | 2 | Metro |
| 9501 | 2019-12-04 | 2019-12-04 10:29:19 | 5 | Walk |
| 9502 | 2019-12-10 | 2019-12-10 15:08:10 | 1 | Other |
| 9503 | 2019-12-10 | 2019-12-10 15:08:13 | 1 | Other |
| 9504 | 2019-12-10 | 2019-12-10 15:07:58 | 1 | Other |
| 9505 | 2019-12-10 | 2019-12-10 15:07:50 | 1 | Other |
| 9506 | 2019-12-17 | 2019-12-17 13:25:56 | 5 | Walk |
| 9507 | 2019-12-17 | 2019-12-17 13:25:54 | 5 | Walk |
| 9508 | 2019-12-21 | 2019-12-21 10:27:34 | 1 | Metro |
| 9509 | 2019-12-21 | 2019-12-21 10:27:49 | 1 | Metro |
| 9510 | 2019-12-05 | 2019-12-05 15:21:56 | 3 | Bus |
| 9511 | 2019-12-05 | 2019-12-05 15:21:36 | 3 | Bus |
| 9512 | 2019-12-07 | 2019-12-07 11:55:37 | 5 | Train |
| 9513 | 2019-12-07 | 2019-12-07 11:55:34 | 5 | Train |
| 9514 | 2019-12-07 | 2019-12-07 11:55:54 | 5 | Train |
| 9515 | 2019-12-08 | 2019-12-08 10:34:37 | 1 | Walk |
| 9516 | 2019-12-08 | 2019-12-08 10:35:01 | 1 | Walk |
| 9517 | 2019-12-15 | 2019-12-15 11:53:13 | 1 | Other |
| 9518 | 2019-12-15 | 2019-12-15 11:53:24 | 1 | Other |
| 9519 | 2019-12-07 | 2019-12-07 11:19:57 | 1 | Bus |
| 9520 | 2019-12-07 | 2019-12-07 11:19:44 | 1 | Bus |
| 9521 | 2019-12-08 | 2019-12-08 09:23:36 | 2 | Metro |
| 9522 | 2019-12-08 | 2019-12-08 09:23:42 | 2 | Metro |
| 9523 | 2019-12-08 | 2019-12-08 09:23:07 | 2 | 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;