SQL exercises on soccer Database: Find the team which was defeated by Portugal in EURO cup 2016 final
SQL soccer Database: Subqueries Exercise-12 with Solution
12. Write a query in SQL to find the team which was defeated by Portugal in EURO cup 2016 final.
Sample table: soccer_country
Sample table: match_details
SELECT country_name FROM soccer_country WHERE country_id=( SELECT team_id FROM match_details WHERE play_stage='F' AND team_id<>( SELECT country_id FROM soccer_country WHERE country_name='Portugal'));
country_name -------------- France (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 match no, date of play and the 2nd highest stoppage time which have been added in the 2nd half of play.
Next: Write a query in SQL to find the club which supplied the most number of players to the 2016 EURO cup.
What is the difficulty level of this exercise?