Joining Subqueries in FROM
The match
table in the European Soccer Database does not contain country or team names. You can get this information by joining it to the country
table, and use this to aggregate information, such as the number of matches played in each country.
If you're interested in filtering data from one of these tables, you can also create a subquery from one of the tables, and then join it to an existing table in the database. A subquery in FROM
is an effective way of answering detailed questions that requires filtering or transforming data before including it in your final results.
Your goal in this exercise is to generate a subquery using the match
table, and then join that subquery to the country
table to calculate information about matches with 10 or more goals in total!
This exercise is part of the course
Data Manipulation in SQL
Hands-on interactive exercise
Have a go at this exercise by completing this sample code.
SELECT
-- Select the country ID and match ID
___,
___
FROM match
-- Filter for matches with 10 or more goals in total
WHERE (___ + ___) >= ___;