View
museum_visit
One row per admitted ticket: the first entry of its day, with the transport answer.
Rows 8,226–8,250 of 9,383
| ticket_idINTEGER | visit_dateany | first_entry_atTEXT | entrance_idINTEGER | transport_modeTEXT |
|---|---|---|---|---|
| 8644 | 2019-08-07 | 2019-08-07 14:39:30 | 1 | Walk |
| 8645 | 2019-07-27 | 2019-07-27 12:13:45 | 4 | Train |
| 8646 | 2019-07-27 | 2019-07-27 12:13:38 | 4 | Train |
| 8647 | 2019-07-27 | 2019-07-27 12:13:47 | 4 | Train |
| 8648 | 2019-07-27 | 2019-07-27 12:35:58 | 2 | Metro |
| 8649 | 2019-07-27 | 2019-07-27 12:36:22 | 2 | Metro |
| 8650 | 2019-07-27 | 2019-07-27 14:55:41 | 2 | Private Vehicle |
| 8651 | 2019-07-27 | 2019-07-27 14:55:40 | 2 | Private Vehicle |
| 8652 | 2019-08-06 | 2019-08-06 09:23:47 | 1 | Walk |
| 8653 | 2019-08-06 | 2019-08-06 09:24:11 | 1 | Walk |
| 8654 | 2019-07-28 | 2019-07-28 13:52:47 | 5 | Bus |
| 8655 | 2019-08-10 | 2019-08-10 10:49:28 | 1 | Train |
| 8656 | 2019-08-10 | 2019-08-10 12:01:15 | 1 | Metro |
| 8658 | 2019-08-10 | 2019-08-10 12:01:09 | 1 | Metro |
| 8659 | 2019-08-03 | 2019-08-03 09:13:04 | 4 | Walk |
| 8660 | 2019-08-03 | 2019-08-03 09:12:40 | 4 | Walk |
| 8661 | 2019-08-03 | 2019-08-03 09:12:56 | 4 | Walk |
| 8662 | 2019-08-03 | 2019-08-03 09:13:28 | 4 | Walk |
| 8663 | 2019-07-30 | 2019-07-30 11:24:27 | 4 | Walk |
| 8664 | 2019-07-30 | 2019-07-30 11:24:26 | 4 | Walk |
| 8665 | 2019-08-04 | 2019-08-04 15:06:52 | 2 | Bus |
| 8666 | 2019-08-04 | 2019-08-04 15:06:56 | 2 | Bus |
| 8667 | 2019-08-04 | 2019-08-04 15:06:55 | 2 | Bus |
| 8668 | 2019-08-04 | 2019-08-04 15:07:30 | 2 | Bus |
| 8669 | 2019-08-01 | 2019-08-01 13:59:07 | 5 | 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;