View
museum_visit
One row per admitted ticket: the first entry of its day, with the transport answer.
Rows 4,401–4,425 of 9,383
| ticket_idINTEGER | visit_dateany | first_entry_atTEXT | entrance_idINTEGER | transport_modeTEXT |
|---|---|---|---|---|
| 4641 | 2017-09-17 | 2017-09-17 12:23:38 | 3 | Metro |
| 4642 | 2017-09-17 | 2017-09-17 12:23:29 | 3 | Metro |
| 4643 | 2017-09-17 | 2017-09-17 12:23:30 | 3 | Metro |
| 4644 | 2017-09-19 | 2017-09-19 14:26:06 | 1 | Bus |
| 4645 | 2017-09-19 | 2017-09-19 14:26:05 | 1 | Bus |
| 4646 | 2017-09-19 | 2017-09-19 14:26:15 | 1 | Bus |
| 4647 | 2017-09-23 | 2017-09-23 13:50:33 | 1 | Taxi |
| 4648 | 2017-09-26 | 2017-09-26 15:16:13 | 4 | Taxi |
| 4649 | 2017-09-20 | 2017-09-20 09:58:02 | 2 | Walk |
| 4650 | 2017-09-20 | 2017-09-20 09:58:45 | 2 | Walk |
| 4651 | 2017-09-27 | 2017-09-27 10:01:12 | 2 | Bus |
| 4652 | 2017-09-27 | 2017-09-27 10:00:46 | 2 | Bus |
| 4653 | 2017-09-27 | 2017-09-27 10:01:07 | 2 | Bus |
| 4654 | 2017-10-01 | 2017-10-01 10:29:56 | 5 | Metro |
| 4655 | 2017-10-01 | 2017-10-01 10:30:25 | 5 | Metro |
| 4656 | 2017-09-22 | 2017-09-22 10:58:44 | 1 | Metro |
| 4657 | 2017-09-22 | 2017-09-22 10:57:56 | 1 | Metro |
| 4658 | 2017-10-01 | 2017-10-01 15:00:09 | 2 | Metro |
| 4659 | 2017-10-01 | 2017-10-01 15:00:30 | 2 | Metro |
| 4660 | 2017-09-22 | 2017-09-22 14:58:42 | 2 | Taxi |
| 4661 | 2017-09-22 | 2017-09-22 14:58:56 | 2 | Taxi |
| 4662 | 2017-09-24 | 2017-09-24 09:41:09 | 1 | Walk |
| 4663 | 2017-09-26 | 2017-09-26 11:57:13 | 1 | Private Vehicle |
| 4664 | 2017-09-26 | 2017-09-26 11:56:49 | 1 | Private Vehicle |
| 4665 | 2017-09-26 | 2017-09-26 11:56:55 | 1 | Private Vehicle |
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;