Advertisement
Guest User

Untitled

a guest
Feb 21st, 2019
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  1. SELECT
  2. sport_name as "Sport Name",
  3. COUNT(discipline_code) as "Number of Disciplines"
  4. FROM
  5. GAMES.SPORT,
  6. GAMES.GAMESDISCIPLINE,
  7. GAMES.SUMMERGAMES
  8. WHERE
  9. sg_year = 2012
  10. GROUP BY
  11. sport_name;
  12.  
  13. SELECT
  14. s.sport_name as "Sport Name",
  15. COUNT(gs.discipline_code) as "Number of Disciplines"
  16. FROM GAMES.SUMMERGAMES sg
  17. JOIN GAMES.GAMESDISCIPLINE gd ON gd.games_id = sg.games_id
  18. JOIN GAMES.SPORT s ON s.discipline_id = gd.discipline_id
  19. WHERE
  20. sg.sg_year = 2012
  21. GROUP BY
  22. s.sport_name;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement