Advertisement
Guest User

Untitled

a guest
May 21st, 2019
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.45 KB | None | 0 0
  1. --First Exercise
  2. SELECT maxtemperaturef, city
  3. FROM weather, stations
  4. GROUP BY maxtemperaturef, city
  5. ORDER BY maxtemperaturef DESC;
  6. --Second Exercise
  7. SELECT start_station,
  8. COUNT(*) as trips_count
  9. FROM trips
  10. GROUP BY start_station;
  11. --Third Exercise
  12. SELECT trip_id, duration
  13. FROM trips
  14. GROUP BY trip_id, duration
  15. ORDER BY duration ASC;
  16. --Fourth Exercise
  17. SELECT end_station,
  18. AVG(duration) as avg_trip
  19. FROM trips
  20. GROUP BY end_station
  21. ORDER BY end_station;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement