View
museum_visit
One row per admitted ticket: the first entry of its day, with the transport answer.
Rows 8,201–8,225 of 9,383
| ticket_idINTEGER | visit_dateany | first_entry_atTEXT | entrance_idINTEGER | transport_modeTEXT |
|---|---|---|---|---|
| 8618 | 2019-10-15 | 2019-10-15 13:45:08 | 1 | Bus |
| 8620 | 2019-10-15 | 2019-10-15 13:44:49 | 1 | Bus |
| 8621 | 2019-10-15 | 2019-10-15 13:45:34 | 1 | Bus |
| 8622 | 2019-10-15 | 2019-10-15 13:45:11 | 1 | Bus |
| 8623 | 2019-10-15 | 2019-10-15 13:45:03 | 1 | Bus |
| 8624 | 2019-10-15 | 2019-10-15 13:44:13 | 1 | Bus |
| 8625 | 2019-10-15 | 2019-10-15 13:45:02 | 1 | Bus |
| 8626 | 2019-10-15 | 2019-10-15 13:46:17 | 1 | Bus |
| 8627 | 2019-10-15 | 2019-10-15 13:44:11 | 1 | Bus |
| 8628 | 2019-10-15 | 2019-10-15 13:47:29 | 1 | Bus |
| 8629 | 2019-10-15 | 2019-10-15 13:45:38 | 1 | Bus |
| 8630 | 2019-10-15 | 2019-10-15 13:47:31 | 1 | Bus |
| 8631 | 2019-07-24 | 2019-07-24 12:07:52 | 1 | Walk |
| 8632 | 2019-07-25 | 2019-07-25 12:56:41 | 1 | Bus |
| 8633 | 2019-07-27 | 2019-07-27 11:13:31 | 1 | Walk |
| 8634 | 2019-07-27 | 2019-07-27 11:13:53 | 1 | Walk |
| 8635 | 2019-07-24 | 2019-07-24 14:43:17 | 1 | Train |
| 8636 | 2019-07-25 | 2019-07-25 10:01:34 | 1 | Metro |
| 8637 | 2019-08-06 | 2019-08-06 14:56:23 | 3 | Bus |
| 8638 | 2019-08-06 | 2019-08-06 14:56:47 | 3 | Bus |
| 8639 | 2019-08-06 | 2019-08-06 14:56:22 | 3 | Bus |
| 8640 | 2019-07-29 | 2019-07-29 13:47:44 | 1 | Walk |
| 8641 | 2019-08-07 | 2019-08-07 14:39:23 | 1 | Walk |
| 8642 | 2019-08-07 | 2019-08-07 14:39:21 | 1 | Walk |
| 8643 | 2019-08-07 | 2019-08-07 14:38:44 | 1 | Walk |
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;