View
museum_visit
One row per admitted ticket: the first entry of its day, with the transport answer.
Rows 6,251–6,275 of 9,383
| ticket_idINTEGER | visit_dateany | first_entry_atTEXT | entrance_idINTEGER | transport_modeTEXT |
|---|---|---|---|---|
| 6577 | 2018-08-31 | 2018-08-31 12:08:33 | 2 | Bus |
| 6578 | 2018-08-31 | 2018-08-31 12:08:39 | 2 | Bus |
| 6579 | 2018-08-31 | 2018-08-31 12:08:34 | 2 | Bus |
| 6580 | 2018-08-30 | 2018-08-30 09:32:53 | 5 | Bus |
| 6581 | 2018-08-30 | 2018-08-30 09:33:03 | 5 | Bus |
| 6582 | 2018-08-30 | 2018-08-30 09:33:02 | 5 | Bus |
| 6583 | 2018-09-03 | 2018-09-03 12:15:45 | 3 | Metro |
| 6584 | 2018-09-03 | 2018-09-03 12:16:30 | 3 | Metro |
| 6585 | 2018-08-30 | 2018-08-30 11:08:53 | 1 | Bus |
| 6586 | 2018-08-30 | 2018-08-30 11:08:45 | 1 | Bus |
| 6587 | 2018-09-11 | 2018-09-11 12:32:27 | 4 | Walk |
| 6588 | 2018-09-02 | 2018-09-02 11:21:32 | 2 | Metro |
| 6589 | 2018-09-02 | 2018-09-02 11:21:32 | 2 | Metro |
| 6590 | 2018-09-02 | 2018-09-02 11:21:23 | 2 | Metro |
| 6591 | 2018-09-02 | 2018-09-02 11:21:23 | 2 | Metro |
| 6592 | 2018-09-02 | 2018-09-02 11:21:50 | 2 | Metro |
| 6593 | 2018-08-31 | 2018-08-31 09:45:37 | 1 | Metro |
| 6594 | 2018-08-31 | 2018-08-31 09:45:08 | 1 | Metro |
| 6595 | 2018-08-31 | 2018-08-31 09:45:16 | 1 | Metro |
| 6596 | 2018-08-31 | 2018-08-31 09:45:25 | 1 | Metro |
| 6597 | 2018-08-31 | 2018-08-31 09:45:44 | 1 | Metro |
| 6598 | 2018-08-31 | 2018-08-31 15:01:28 | 1 | Walk |
| 6599 | 2018-08-31 | 2018-08-31 15:01:31 | 1 | Walk |
| 6600 | 2018-08-31 | 2018-08-31 15:00:57 | 1 | Walk |
| 6601 | 2018-08-31 | 2018-08-31 15:01:11 | 1 | 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;