View
museum_visit
One row per admitted ticket: the first entry of its day, with the transport answer.
Rows 9,276–9,300 of 9,383
| ticket_idINTEGER | visit_dateany | first_entry_atTEXT | entrance_idINTEGER | transport_modeTEXT |
|---|---|---|---|---|
| 9732 | 2020-01-25 | 2020-01-25 09:02:58 | 2 | Taxi |
| 9733 | 2020-01-25 | 2020-01-25 09:03:08 | 2 | Taxi |
| 9734 | 2020-02-23 | 2020-02-23 10:44:44 | 3 | Private Vehicle |
| 9735 | 2020-02-23 | 2020-02-23 10:44:41 | 3 | Private Vehicle |
| 9736 | 2020-01-26 | 2020-01-26 12:14:57 | 3 | Bus |
| 9737 | 2020-01-29 | 2020-01-29 13:01:08 | 1 | Other |
| 9738 | 2020-01-29 | 2020-01-29 13:01:28 | 1 | Other |
| 9739 | 2020-01-29 | 2020-01-29 13:01:14 | 1 | Other |
| 9740 | 2020-01-27 | 2020-01-27 09:07:00 | 5 | Walk |
| 9741 | 2020-01-31 | 2020-01-31 12:39:15 | 1 | Metro |
| 9742 | 2020-02-05 | 2020-02-05 12:24:40 | 1 | Bus |
| 9743 | 2020-02-05 | 2020-02-05 12:25:08 | 1 | Bus |
| 9744 | 2020-02-05 | 2020-02-05 12:25:14 | 1 | Bus |
| 9745 | 2020-01-29 | 2020-01-29 11:00:13 | 2 | Taxi |
| 9746 | 2020-02-23 | 2020-02-23 11:38:38 | 3 | Metro |
| 9747 | 2020-02-23 | 2020-02-23 11:38:03 | 3 | Metro |
| 9748 | 2020-02-23 | 2020-02-23 11:38:37 | 3 | Metro |
| 9749 | 2020-02-23 | 2020-02-23 11:38:16 | 3 | Metro |
| 9750 | 2020-02-07 | 2020-02-07 13:18:32 | 1 | Metro |
| 9751 | 2020-02-04 | 2020-02-04 14:30:23 | 1 | Bus |
| 9752 | 2020-02-01 | 2020-02-01 11:28:35 | 1 | Walk |
| 9753 | 2020-02-01 | 2020-02-01 11:28:20 | 1 | Walk |
| 9754 | 2020-02-09 | 2020-02-09 11:17:46 | 1 | Walk |
| 9755 | 2020-02-09 | 2020-02-09 11:17:09 | 1 | Walk |
| 9756 | 2020-02-01 | 2020-02-01 12:32:12 | 1 | 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;