SQL exercises on soccer Database: Find the number of goals Germany scored at the tournament
SQL soccer Database: Subqueries Exercise-17 with Solution
17. Write a query in SQL to find the number of goals Germany scored at the tournament.
Sample table: goal_details
Sample table: soccer_country
SELECT COUNT(player_id) FROM goal_details WHERE team_id= ( SELECT country_id FROM soccer_country WHERE country_name='Germany' );
count ------- 7 (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?
- New Content published on w3resource:
- Scala Programming Exercises, Practice, Solution
- Python Itertools exercises
- Python Numpy exercises
- Python GeoPy Package exercises
- Python Pandas exercises
- Python nltk exercises
- Python BeautifulSoup exercises
- Form Template
- Composer - PHP Package Manager
- PHPUnit - PHP Testing
- Laravel - PHP Framework