View
museum_visit
One row per admitted ticket: the first entry of its day, with the transport answer.
Rows 7,476–7,500 of 9,383
| ticket_idINTEGER | visit_dateany | first_entry_atTEXT | entrance_idINTEGER | transport_modeTEXT |
|---|---|---|---|---|
| 7876 | 2019-03-19 | 2019-03-19 13:32:18 | 4 | Bus |
| 7877 | 2019-03-19 | 2019-03-19 13:32:00 | 4 | Bus |
| 7878 | 2019-03-21 | 2019-03-21 12:48:09 | 5 | Bus |
| 7879 | 2019-03-21 | 2019-03-21 12:48:13 | 5 | Bus |
| 7880 | 2019-03-21 | 2019-03-21 12:48:46 | 5 | Bus |
| 7881 | 2019-03-21 | 2019-03-21 12:48:45 | 5 | Bus |
| 7882 | 2019-04-03 | 2019-04-03 09:26:58 | 2 | Private Vehicle |
| 7883 | 2019-04-03 | 2019-04-03 09:26:59 | 2 | Private Vehicle |
| 7884 | 2019-03-20 | 2019-03-20 14:32:46 | 2 | Metro |
| 7885 | 2019-03-20 | 2019-03-20 14:32:48 | 2 | Metro |
| 7886 | 2019-04-23 | 2019-04-23 13:48:15 | 1 | Metro |
| 7887 | 2019-04-23 | 2019-04-23 13:48:12 | 1 | Metro |
| 7888 | 2019-03-21 | 2019-03-21 14:28:45 | 2 | Train |
| 7889 | 2019-03-21 | 2019-03-21 14:28:54 | 2 | Train |
| 7890 | 2019-03-24 | 2019-03-24 09:06:28 | 3 | Bus |
| 7891 | 2019-03-24 | 2019-03-24 09:34:17 | 1 | Metro |
| 7892 | 2019-03-24 | 2019-03-24 09:34:00 | 1 | Metro |
| 7893 | 2019-03-24 | 2019-03-24 09:34:14 | 1 | Metro |
| 7894 | 2019-03-29 | 2019-03-29 14:25:03 | 1 | Walk |
| 7895 | 2019-03-30 | 2019-03-30 12:53:22 | 5 | Walk |
| 7896 | 2019-03-30 | 2019-03-30 12:52:54 | 5 | Walk |
| 7897 | 2019-03-30 | 2019-03-30 12:52:46 | 5 | Walk |
| 7898 | 2019-03-30 | 2019-03-30 12:52:39 | 5 | Walk |
| 7899 | 2019-03-30 | 2019-03-30 12:53:14 | 5 | Walk |
| 7900 | 2019-04-17 | 2019-04-17 12:51:09 | 4 | Taxi |
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;