View
museum_visit
One row per admitted ticket: the first entry of its day, with the transport answer.
Rows 6,176–6,200 of 9,383
| ticket_idINTEGER | visit_dateany | first_entry_atTEXT | entrance_idINTEGER | transport_modeTEXT |
|---|---|---|---|---|
| 6499 | 2018-08-19 | 2018-08-19 12:46:05 | 4 | Other |
| 6500 | 2018-08-19 | 2018-08-19 12:46:04 | 4 | Other |
| 6501 | 2018-08-26 | 2018-08-26 14:08:53 | 1 | Other |
| 6502 | 2018-08-26 | 2018-08-26 14:08:57 | 1 | Other |
| 6503 | 2018-08-20 | 2018-08-20 12:53:24 | 1 | Walk |
| 6504 | 2018-08-20 | 2018-08-20 12:53:28 | 1 | Walk |
| 6505 | 2018-08-21 | 2018-08-21 09:35:16 | 5 | Walk |
| 6506 | 2018-08-21 | 2018-08-21 09:35:50 | 5 | Walk |
| 6507 | 2018-10-11 | 2018-10-11 11:37:25 | 1 | Walk |
| 6508 | 2018-10-11 | 2018-10-11 11:37:28 | 1 | Walk |
| 6509 | 2018-08-22 | 2018-08-22 09:55:53 | 5 | Walk |
| 6510 | 2018-08-22 | 2018-08-22 09:56:02 | 5 | Walk |
| 6511 | 2018-08-22 | 2018-08-22 09:56:27 | 5 | Walk |
| 6512 | 2018-08-22 | 2018-08-22 09:56:36 | 5 | Walk |
| 6513 | 2018-08-25 | 2018-08-25 10:35:05 | 2 | Metro |
| 6514 | 2018-08-23 | 2018-08-23 09:34:24 | 1 | Bus |
| 6515 | 2018-08-23 | 2018-08-23 09:34:44 | 1 | Bus |
| 6516 | 2018-08-23 | 2018-08-23 09:34:39 | 1 | Bus |
| 6517 | 2018-09-28 | 2018-09-28 14:09:22 | 1 | Walk |
| 6518 | 2018-10-05 | 2018-10-05 11:42:18 | 4 | Bus |
| 6519 | 2018-10-05 | 2018-10-05 11:42:31 | 4 | Bus |
| 6520 | 2018-10-05 | 2018-10-05 11:42:36 | 4 | Bus |
| 6521 | 2018-10-05 | 2018-10-05 11:42:30 | 4 | Bus |
| 6522 | 2018-10-05 | 2018-10-05 11:42:46 | 4 | Bus |
| 6524 | 2018-10-05 | 2018-10-05 11:43:08 | 4 | Bus |
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;