View
museum_visit
One row per admitted ticket: the first entry of its day, with the transport answer.
Rows 1,876–1,900 of 9,383
| ticket_idINTEGER | visit_dateany | first_entry_atTEXT | entrance_idINTEGER | transport_modeTEXT |
|---|---|---|---|---|
| 1985 | 2016-03-28 | 2016-03-28 11:05:22 | 1 | Other |
| 1986 | 2016-03-28 | 2016-03-28 11:05:43 | 1 | Other |
| 1987 | 2016-03-28 | 2016-03-28 11:05:04 | 1 | Other |
| 1988 | 2016-03-28 | 2016-03-28 11:04:58 | 1 | Other |
| 1989 | 2016-03-25 | 2016-03-25 12:18:11 | 4 | Bus |
| 1990 | 2016-03-25 | 2016-03-25 12:17:33 | 4 | Bus |
| 1991 | 2016-03-29 | 2016-03-29 09:08:12 | 1 | Bus |
| 1993 | 2016-03-29 | 2016-03-29 09:08:49 | 1 | Bus |
| 1994 | 2016-03-29 | 2016-03-29 09:08:22 | 1 | Bus |
| 1995 | 2016-03-29 | 2016-03-29 09:08:23 | 1 | Bus |
| 1996 | 2016-03-26 | 2016-03-26 09:41:40 | 5 | Bus |
| 1997 | 2016-03-26 | 2016-03-26 09:56:26 | 3 | Metro |
| 1998 | 2016-03-26 | 2016-03-26 09:55:58 | 3 | Metro |
| 1999 | 2016-03-26 | 2016-03-26 10:12:58 | 2 | Private Vehicle |
| 2000 | 2016-03-26 | 2016-03-26 10:13:07 | 2 | Private Vehicle |
| 2001 | 2016-04-01 | 2016-04-01 14:01:45 | 4 | Bus |
| 2002 | 2016-04-01 | 2016-04-01 14:01:49 | 4 | Bus |
| 2003 | 2016-04-01 | 2016-04-01 14:01:46 | 4 | Bus |
| 2004 | 2016-04-01 | 2016-04-01 14:01:02 | 4 | Bus |
| 2005 | 2016-04-01 | 2016-04-01 14:01:24 | 4 | Bus |
| 2006 | 2016-03-28 | 2016-03-28 12:04:57 | 2 | Metro |
| 2007 | 2016-03-28 | 2016-03-28 15:01:15 | 5 | Taxi |
| 2008 | 2016-03-29 | 2016-03-29 09:40:09 | 1 | Walk |
| 2009 | 2016-03-29 | 2016-03-29 09:39:59 | 1 | Walk |
| 2010 | 2016-03-29 | 2016-03-29 09:40:37 | 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;