View
museum_visit
One row per admitted ticket: the first entry of its day, with the transport answer.
Rows 5,551–5,575 of 9,383
| ticket_idINTEGER | visit_dateany | first_entry_atTEXT | entrance_idINTEGER | transport_modeTEXT |
|---|---|---|---|---|
| 5858 | 2018-08-29 | 2018-08-29 13:47:59 | 4 | Bus |
| 5859 | 2018-08-29 | 2018-08-29 13:47:16 | 4 | Bus |
| 5860 | 2018-08-29 | 2018-08-29 13:47:21 | 4 | Bus |
| 5861 | 2018-08-29 | 2018-08-29 13:51:29 | 4 | Bus |
| 5862 | 2018-08-29 | 2018-08-29 13:48:27 | 4 | Bus |
| 5863 | 2018-08-29 | 2018-08-29 13:48:34 | 4 | Bus |
| 5864 | 2018-08-29 | 2018-08-29 13:51:41 | 4 | Bus |
| 5865 | 2018-06-17 | 2018-06-17 15:53:19 | 1 | Train |
| 5866 | 2018-06-17 | 2018-06-17 15:53:39 | 1 | Train |
| 5867 | 2018-06-17 | 2018-06-17 15:53:25 | 1 | Train |
| 5868 | 2018-05-30 | 2018-05-30 09:34:23 | 3 | Train |
| 5869 | 2018-05-30 | 2018-05-30 09:34:46 | 3 | Train |
| 5870 | 2018-05-30 | 2018-05-30 11:44:55 | 4 | Walk |
| 5871 | 2018-05-30 | 2018-05-30 11:44:54 | 4 | Walk |
| 5872 | 2018-05-31 | 2018-05-31 09:52:36 | 5 | Walk |
| 5873 | 2018-05-31 | 2018-05-31 16:59:53 | 2 | Walk |
| 5874 | 2018-05-31 | 2018-05-31 16:59:36 | 2 | Walk |
| 5875 | 2018-05-31 | 2018-05-31 11:03:46 | 1 | Metro |
| 5876 | 2018-05-31 | 2018-05-31 12:28:38 | 2 | Walk |
| 5877 | 2018-05-31 | 2018-05-31 12:29:27 | 2 | Walk |
| 5878 | 2018-06-05 | 2018-06-05 13:31:14 | 1 | Metro |
| 5879 | 2018-06-05 | 2018-06-05 13:31:50 | 1 | Metro |
| 5880 | 2018-06-05 | 2018-06-05 13:31:59 | 1 | Metro |
| 5881 | 2018-06-05 | 2018-06-05 13:31:29 | 1 | Metro |
| 5885 | 2018-06-02 | 2018-06-02 11:40:28 | 4 | 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;