SQL exercises on soccer Database: Find the teams who played the heighest audence match
SQL soccer Database: Subqueries Exercise-7 with Solution
7. Write a query in SQL to find the teams who played the heighest audence match.
Sample table: soccer_country
Sample table: goal_details
Sample table: match_mast
SELECT country_name FROM soccer_country WHERE country_id IN( SELECT team_id FROM goal_details WHERE match_no=( SELECT match_no FROM match_mast WHERE audence=( SELECT max(audence) FROM match_mast) ORDER BY audence DESC));
country_name -------------- France Iceland (2 rows)
Sample Database: soccer
Have another way to solve this solution? Contribute your code (and comments) through Disqus.
Previous: Write a query in SQL to display the list of players scored number of goals in every matches.
Next: Write a query in SQL to find the player who scored the last goal for Portugal against Hungary.
What is the difficulty level of this exercise?