View
museum_visit
One row per admitted ticket: the first entry of its day, with the transport answer.
Rows 5,151–5,175 of 9,383
| ticket_idINTEGER | visit_dateany | first_entry_atTEXT | entrance_idINTEGER | transport_modeTEXT |
|---|---|---|---|---|
| 5430 | 2018-03-22 | 2018-03-22 09:05:58 | 1 | Metro |
| 5431 | 2018-03-29 | 2018-03-29 09:46:16 | 4 | Bus |
| 5432 | 2018-03-17 | 2018-03-17 11:25:00 | 1 | Metro |
| 5433 | 2018-03-17 | 2018-03-17 11:25:36 | 1 | Metro |
| 5434 | 2018-03-17 | 2018-03-17 11:25:14 | 1 | Metro |
| 5435 | 2018-03-17 | 2018-03-17 11:25:11 | 1 | Metro |
| 5436 | 2018-03-18 | 2018-03-18 16:31:04 | 1 | Walk |
| 5437 | 2018-03-18 | 2018-03-18 10:44:18 | 5 | Walk |
| 5438 | 2018-03-18 | 2018-03-18 10:44:10 | 5 | Walk |
| 5439 | 2018-03-18 | 2018-03-18 11:11:58 | 1 | Walk |
| 5440 | 2018-03-18 | 2018-03-18 11:12:36 | 1 | Walk |
| 5441 | 2018-03-25 | 2018-03-25 11:18:59 | 3 | Private Vehicle |
| 5442 | 2018-03-30 | 2018-03-30 14:16:18 | 3 | Walk |
| 5443 | 2018-03-21 | 2018-03-21 09:27:19 | 2 | Private Vehicle |
| 5444 | 2018-03-21 | 2018-03-21 09:27:45 | 2 | Private Vehicle |
| 5445 | 2018-03-20 | 2018-03-20 13:09:28 | 3 | Bus |
| 5446 | 2018-03-20 | 2018-03-20 13:09:13 | 3 | Bus |
| 5447 | 2018-03-20 | 2018-03-20 13:09:43 | 3 | Bus |
| 5448 | 2018-03-20 | 2018-03-20 13:09:46 | 3 | Bus |
| 5449 | 2018-03-20 | 2018-03-20 13:09:08 | 3 | Bus |
| 5450 | 2018-04-08 | 2018-04-08 11:53:41 | 5 | Walk |
| 5451 | 2018-03-21 | 2018-03-21 09:35:22 | 4 | Bus |
| 5452 | 2018-04-02 | 2018-04-02 11:48:33 | 1 | Walk |
| 5453 | 2018-04-02 | 2018-04-02 11:48:33 | 1 | Walk |
| 5454 | 2018-03-25 | 2018-03-25 11:33:20 | 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;