Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Q1:What was the hottest day in our data set? Where was that?
- A1: Hottest day had a temperature of 134 degrees in the area code 94063 on Novermeber 11th, 2015.
- SELECT
- zip,
- MAX(maxtemperaturef)
- FROM
- weather
- GROUP BY zip
- SELECT
- date,
- maxtemperaturef,
- zip
- FROM
- weather
- ORDER BY maxtemperaturef DESC
- Q2: How many trips started at each station?
- A2:The top three stations are SF Caltrain on 4th, SF Caltrain on 330 Townsend,
- and Ferry Building. With 23,591, 22,358, and 16,128 trips starting from those stations, respectively.
- SELECT
- COUNT(*),
- start_station
- FROM
- trips
- GROUP BY start_station
- ORDER BY COUNT DESC
- Q3: What's the shortest trip that happened?
- A3: The shortest trip duration was 60 seconds, 14 trips in the data set were 60 seconds long. Originating
- from stations, such as the Temp Transbay Terminal, San Jose Diridon Caltrain Station, and Union Square in SF.
- SELECT
- MIN(duration) as duration_second,
- start_station
- FROM
- trips
- GROUP BY start_station
- ORDER BY duration_second ASC
- Q4: What is the average trip duration, by end station?
- SELECT
- end_station,
- AVG(duration) as avg_duration
- FROM
- trips
- GROUP BY end_station
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement