View
museum_visit
One row per admitted ticket: the first entry of its day, with the transport answer.
Rows 6,076–6,100 of 9,383
| ticket_idINTEGER | visit_dateany | first_entry_atTEXT | entrance_idINTEGER | transport_modeTEXT |
|---|---|---|---|---|
| 6398 | 2018-08-05 | 2018-08-05 13:01:01 | 1 | Walk |
| 6399 | 2018-08-05 | 2018-08-05 13:00:20 | 1 | Walk |
| 6400 | 2018-08-05 | 2018-08-05 13:00:47 | 1 | Walk |
| 6401 | 2018-08-16 | 2018-08-16 16:21:58 | 2 | Bus |
| 6402 | 2018-08-06 | 2018-08-06 09:59:03 | 2 | Metro |
| 6403 | 2018-08-06 | 2018-08-06 11:32:18 | 1 | Other |
| 6404 | 2018-08-06 | 2018-08-06 11:32:13 | 1 | Other |
| 6405 | 2018-08-06 | 2018-08-06 12:54:09 | 1 | Other |
| 6406 | 2018-08-06 | 2018-08-06 12:54:07 | 1 | Other |
| 6407 | 2018-08-20 | 2018-08-20 10:36:02 | 3 | Bus |
| 6408 | 2018-08-11 | 2018-08-11 10:44:43 | 1 | Bus |
| 6409 | 2018-08-11 | 2018-08-11 10:44:45 | 1 | Bus |
| 6410 | 2018-08-07 | 2018-08-07 10:43:41 | 1 | Taxi |
| 6411 | 2018-08-07 | 2018-08-07 10:43:26 | 1 | Taxi |
| 6412 | 2018-08-07 | 2018-08-07 10:43:28 | 1 | Taxi |
| 6413 | 2018-08-07 | 2018-08-07 16:31:45 | 5 | Metro |
| 6414 | 2018-08-07 | 2018-08-07 16:31:59 | 5 | Metro |
| 6415 | 2018-08-08 | 2018-08-08 11:10:14 | 1 | Bus |
| 6416 | 2018-08-25 | 2018-08-25 10:15:02 | 1 | Bus |
| 6417 | 2018-08-25 | 2018-08-25 10:15:22 | 1 | Bus |
| 6418 | 2018-08-13 | 2018-08-13 10:28:05 | 5 | Walk |
| 6419 | 2018-08-13 | 2018-08-13 10:28:30 | 5 | Walk |
| 6420 | 2018-08-13 | 2018-08-13 10:28:00 | 5 | Walk |
| 6421 | 2018-08-13 | 2018-08-13 10:28:07 | 5 | Walk |
| 6422 | 2018-08-13 | 2018-08-13 10:28:11 | 5 | 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;