View
museum_visit
One row per admitted ticket: the first entry of its day, with the transport answer.
Rows 2,001–2,025 of 9,383
| ticket_idINTEGER | visit_dateany | first_entry_atTEXT | entrance_idINTEGER | transport_modeTEXT |
|---|---|---|---|---|
| 2112 | 2016-05-07 | 2016-05-07 14:10:29 | 1 | Metro |
| 2113 | 2016-05-01 | 2016-05-01 09:44:37 | 5 | Bus |
| 2114 | 2016-05-01 | 2016-05-01 09:45:12 | 5 | Bus |
| 2115 | 2016-05-01 | 2016-05-01 09:44:45 | 5 | Bus |
| 2116 | 2016-05-01 | 2016-05-01 09:45:04 | 5 | Bus |
| 2117 | 2016-05-01 | 2016-05-01 11:33:03 | 4 | Bus |
| 2118 | 2016-05-01 | 2016-05-01 11:32:57 | 4 | Bus |
| 2120 | 2016-05-01 | 2016-05-01 16:59:59 | 1 | Bus |
| 2121 | 2016-05-01 | 2016-05-01 16:59:52 | 1 | Bus |
| 2122 | 2016-05-02 | 2016-05-02 09:14:46 | 1 | Bus |
| 2123 | 2016-05-02 | 2016-05-02 09:15:00 | 1 | Bus |
| 2124 | 2016-05-02 | 2016-05-02 10:48:28 | 2 | Metro |
| 2125 | 2016-05-02 | 2016-05-02 10:47:53 | 2 | Metro |
| 2126 | 2016-05-02 | 2016-05-02 10:08:01 | 3 | Walk |
| 2127 | 2016-05-02 | 2016-05-02 10:07:47 | 3 | Walk |
| 2128 | 2016-05-14 | 2016-05-14 14:18:03 | 1 | Walk |
| 2129 | 2016-05-14 | 2016-05-14 14:18:00 | 1 | Walk |
| 2130 | 2016-05-14 | 2016-05-14 14:17:37 | 1 | Walk |
| 2131 | 2016-05-08 | 2016-05-08 14:26:20 | 1 | Bus |
| 2132 | 2016-05-08 | 2016-05-08 14:26:19 | 1 | Bus |
| 2133 | 2016-05-03 | 2016-05-03 09:25:12 | 3 | Metro |
| 2134 | 2016-05-03 | 2016-05-03 09:25:37 | 3 | Metro |
| 2135 | 2016-05-03 | 2016-05-03 13:45:28 | 1 | Metro |
| 2136 | 2016-05-10 | 2016-05-10 13:59:28 | 1 | Metro |
| 2137 | 2016-05-04 | 2016-05-04 10:52:09 | 2 | Metro |
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;