View
museum_visit
One row per admitted ticket: the first entry of its day, with the transport answer.
Rows 6,351–6,375 of 9,383
| ticket_idINTEGER | visit_dateany | first_entry_atTEXT | entrance_idINTEGER | transport_modeTEXT |
|---|---|---|---|---|
| 6677 | 2018-12-24 | 2018-12-24 10:32:28 | 1 | Bus |
| 6678 | 2018-12-24 | 2018-12-24 10:28:14 | 1 | Bus |
| 6679 | 2018-12-24 | 2018-12-24 10:30:08 | 1 | Bus |
| 6680 | 2018-12-24 | 2018-12-24 10:32:06 | 1 | Bus |
| 6681 | 2018-12-24 | 2018-12-24 10:26:40 | 1 | Bus |
| 6682 | 2018-12-24 | 2018-12-24 10:31:29 | 1 | Bus |
| 6683 | 2018-12-24 | 2018-12-24 10:36:28 | 1 | Bus |
| 6684 | 2018-12-24 | 2018-12-24 10:27:51 | 1 | Bus |
| 6685 | 2018-09-10 | 2018-09-10 09:33:03 | 3 | Bus |
| 6686 | 2018-09-18 | 2018-09-18 10:59:15 | 1 | Train |
| 6687 | 2018-09-18 | 2018-09-18 10:58:42 | 1 | Train |
| 6688 | 2018-09-11 | 2018-09-11 11:34:14 | 2 | Private Vehicle |
| 6689 | 2018-09-11 | 2018-09-11 11:33:53 | 2 | Private Vehicle |
| 6690 | 2018-09-29 | 2018-09-29 12:16:02 | 1 | Bus |
| 6691 | 2018-09-29 | 2018-09-29 12:15:44 | 1 | Bus |
| 6692 | 2018-09-23 | 2018-09-23 13:52:06 | 1 | Walk |
| 6693 | 2018-09-12 | 2018-09-12 10:08:43 | 1 | Metro |
| 6694 | 2018-09-12 | 2018-09-12 11:23:59 | 1 | Walk |
| 6695 | 2018-09-12 | 2018-09-12 11:24:02 | 1 | Walk |
| 6697 | 2018-10-25 | 2018-10-25 14:21:34 | 1 | Walk |
| 6698 | 2018-10-25 | 2018-10-25 14:21:27 | 1 | Walk |
| 6699 | 2018-10-25 | 2018-10-25 14:21:57 | 1 | Walk |
| 6700 | 2018-09-19 | 2018-09-19 11:59:21 | 1 | Other |
| 6701 | 2018-09-19 | 2018-09-19 11:59:25 | 1 | Other |
| 6702 | 2018-10-09 | 2018-10-09 15:08:51 | 4 | 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;