w3resource
Soccer Database Exercises

SQL exercises on soccer Database: Find the name of the venue with city where the EURO cup 2016 final match was played

SQL soccer Database: Joins Exercise-1 with Solution

1. Write a query in SQL to find the name of the venue with city where the EURO cup 2016 final match was played.

Sample table: soccer_venue


Sample table: soccer_city


Sample table: match_mast


Sample Solution:

SQL Code:

SELECT venue_name, city
FROM soccer_venue a
JOIN soccer_city b ON a.city_id=b.city_id
JOIN match_mast d ON d.venue_id=a.venue_id 
AND d.play_stage='F';

Sample Output:

   venue_name    |    city
-----------------+-------------
 Stade de France | Saint-Denis
(1 row)

Query Visualization:

Duration:

Query visualization of Find the name of the venue with city where the EURO cup 2016 final match was played - Duration

Rows:

Query visualization of Find the name of the venue with city where the EURO cup 2016 final match was played - Rows

Cost:

Query visualization of Find the name of the venue with city where the EURO cup 2016 final match was played - 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: SQL JOINS Exercises on Soccer Database
Next: Write a query in SQL to find the number of goal scored by each team in every match within normal play schedule.

What is the difficulty level of this exercise?



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