w3resource
Soccer Database Exercises

SQL exercises on soccer Database: Find the country where Football EURO cup 2016 held

SQL soccer Database: Joins Exercise-6 with Solution

6. Write a query in SQL to find the country where Football EURO cup 2016 held.

Sample table: soccer_country


Sample table: soccer_city


Sample table: soccer_venue


Sample Solution:

SQL Code:

SELECT country_name
FROM soccer_country a
JOIN soccer_city b ON a.country_id=b.country_id
JOIN soccer_venue c ON b.city_id=c.city_id
GROUP BY country_name;

Sample Output:

 country_name
--------------
 France
(1 row)

Query Visualization:

Duration:

Query visualization of Find the country where Football EURO cup 2016 held - Duration

Rows:

Query visualization of Find the country where Football EURO cup 2016 held - Rows

Cost:

Query visualization of Find the country where Football EURO cup 2016 held - Cost

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 the scorer of only goal along with his country and jersey number in the final of EURO cup 2016.
Next: Write a query in SQL to find the player who socred first goal of EURO cup 2016.

What is the difficulty level of this exercise?



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