Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- SELECT
- sport_name as "Sport Name",
- COUNT(discipline_code) as "Number of Disciplines"
- FROM
- GAMES.SPORT,
- GAMES.GAMESDISCIPLINE,
- GAMES.SUMMERGAMES
- WHERE
- sg_year = 2012
- GROUP BY
- sport_name;
- SELECT
- s.sport_name as "Sport Name",
- COUNT(gs.discipline_code) as "Number of Disciplines"
- FROM GAMES.SUMMERGAMES sg
- JOIN GAMES.GAMESDISCIPLINE gd ON gd.games_id = sg.games_id
- JOIN GAMES.SPORT s ON s.discipline_id = gd.discipline_id
- WHERE
- sg.sg_year = 2012
- GROUP BY
- s.sport_name;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement