SQL exercises on soccer Database: Find the number of Germany scored at the tournament
SQL soccer Database: Subqueries Exercise-17 with Solution
17. Write a query in SQL to find the number of Germany scored at the tournament.
Sample table: goal_details
Sample table: soccer_country
SELECT COUNT(distinct player_id) FROM goal_details WHERE team_id= ( SELECT country_id FROM soccer_country WHERE country_name='Germany' );
count ------- 6 (1 row)
Sample Database: soccer
Have another way to solve this solution? Contribute your code (and comments) through Disqus.
Previous: Write a query in SQL to find the player who was the goalkeeper for Italy in penalty shootout against Germany in Football EURO cup 2016.
Next: Write a query in SQL to find the players along with their jersey no., and playing club, who were the goalkeepers for the England squad for 2016 EURO cup.
What is the difficulty level of this exercise?