View
museum_visit
One row per admitted ticket: the first entry of its day, with the transport answer.
Rows 6,151–6,175 of 9,383
| ticket_idINTEGER | visit_dateany | first_entry_atTEXT | entrance_idINTEGER | transport_modeTEXT |
|---|---|---|---|---|
| 6474 | 2018-08-16 | 2018-08-16 13:21:25 | 3 | Taxi |
| 6475 | 2018-08-16 | 2018-08-16 12:40:37 | 1 | Train |
| 6476 | 2018-08-17 | 2018-08-17 09:50:39 | 3 | Metro |
| 6477 | 2018-08-17 | 2018-08-17 09:50:37 | 3 | Metro |
| 6478 | 2018-08-17 | 2018-08-17 09:49:51 | 3 | Metro |
| 6479 | 2018-08-17 | 2018-08-17 11:17:52 | 1 | Metro |
| 6480 | 2018-08-17 | 2018-08-17 11:18:08 | 1 | Metro |
| 6481 | 2018-08-17 | 2018-08-17 11:17:57 | 1 | Metro |
| 6482 | 2018-08-17 | 2018-08-17 11:18:15 | 1 | Metro |
| 6483 | 2018-08-17 | 2018-08-17 11:25:02 | 1 | Walk |
| 6484 | 2018-09-20 | 2018-09-20 14:05:38 | 1 | Metro |
| 6485 | 2018-08-18 | 2018-08-18 10:39:18 | 1 | Metro |
| 6486 | 2018-08-18 | 2018-08-18 10:39:59 | 1 | Metro |
| 6487 | 2018-08-18 | 2018-08-18 10:39:14 | 1 | Metro |
| 6488 | 2018-08-18 | 2018-08-18 10:39:25 | 1 | Metro |
| 6489 | 2018-08-18 | 2018-08-18 12:47:32 | 4 | Bus |
| 6490 | 2018-08-18 | 2018-08-18 12:47:33 | 4 | Bus |
| 6491 | 2018-08-18 | 2018-08-18 12:47:36 | 4 | Bus |
| 6492 | 2018-08-18 | 2018-08-18 15:53:00 | 3 | Metro |
| 6493 | 2018-08-18 | 2018-08-18 15:53:25 | 3 | Metro |
| 6494 | 2018-08-24 | 2018-08-24 09:24:23 | 1 | Walk |
| 6495 | 2018-08-19 | 2018-08-19 09:12:24 | 2 | Metro |
| 6496 | 2018-08-19 | 2018-08-19 11:08:18 | 4 | Bus |
| 6497 | 2018-08-19 | 2018-08-19 11:08:40 | 4 | Bus |
| 6498 | 2018-08-19 | 2018-08-19 11:08:07 | 4 | Bus |
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;