Soccer Database Exercises

SQL exercises on soccer Database: Find the final four teams in the tournament

SQL soccer Database: Joins Exercise-30 with Solution

30. Write a query in SQL to find the final four teams in the tournament.

Sample table: soccer_country

Sample table: match_details

Sample Solution:

SQL Code:

SELECT country_name
FROM match_details a
JOIN soccer_country b
ON a.team_id=b.country_id
WHERE play_stage='S';

Sample Output:

(4 rows)

Practice Online

Sample Database: soccer

soccer database relationship structure

Have another way to solve this solution? Contribute your code (and comments) through Disqus.

Previous: Write a query in SQL to find those three players with other information, who contracted to Lyon participated in the EURO cup 2016 Finals.
Next: Write a query in SQL to find the captains for the top four teams with other information which participated in the semifinals (match 48 and 49) in the tournament.

What is the difficulty level of this exercise?

New Content: Composer: Dependency manager for PHP, R Programming