Advertisement
Guest User

Untitled

a guest
Mar 22nd, 2019
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.82 KB | None | 0 0
  1. -- What was the hottest day in our data set? Where was that?
  2. -- select
  3. -- *
  4. -- from
  5. -- weather
  6. -- where
  7. -- maxtemperaturef =(
  8. -- select
  9. -- MAX (maxtemperaturef)
  10. -- from
  11. -- weather
  12. -- );
  13. -----------------------------------------------------------------
  14. -- select
  15. -- MAX (maxtemperaturef),zip
  16. -- from
  17. -- weather
  18. -- group by
  19. -- zip
  20. --How many trips started at each station?
  21.  
  22. -- select
  23. -- count(*), start_terminal
  24. -- from
  25. -- trips
  26. -- group by
  27. -- start_terminal
  28. -----------------------------------------------------
  29. -- What's the shortest trip that happened?
  30. -- select
  31. -- MIN (duration)
  32. -- from
  33. -- trips
  34. ------------------------------------------------------
  35. -- What is the average trip duration, by end station?
  36. -- select
  37. -- end_terminal, avg (duration) as avg_duration
  38. -- from
  39. -- trips
  40. -- group by 1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement