w3resource
Soccer Database Exercises

SQL exercises on soccer Database: Find the stadium hosted the final match of EURO cup 2016 along with the capacity, and audance for that match

SQL soccer Database: Joins Exercise-13 with Solution

13. Write a query in SQL to find the stadium hosted the final match of EURO cup 2016 along with the capacity, and audance for that match.

Sample table: soccer_venue


Sample table: soccer_city


Sample table: match_mast


Sample Solution:

SQL Code:

SELECT a.venue_name, b.city, a.aud_capacity, c.audence
FROM soccer_venue a
JOIN soccer_city b ON a.city_id=b.city_id
JOIN match_mast c ON a.venue_id=c.venue_id
WHERE play_stage=\'F\';

Sample Output:

   venue_name    |    city     | aud_capacity | audence
-----------------+-------------+--------------+---------
 Stade de France | Saint-Denis |        80100 |   75868
(1 row)

Query Visualization:

Duration:

Query visualization of Find the stadium hosted the final match of EURO cup 2016 along with the capacity, and audance for that match - Duration

Rows:

Query visualization of Find the stadium hosted the final match of EURO cup 2016 along with the capacity, and audance for that match - Rows

Cost:

Query visualization of Find the stadium hosted the final match of EURO cup 2016 along with the capacity, and audance for that match - 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 city where the opening match of EURO cup 2016 played.
Next: Write a query in SQL to compute a report that contain the number of matches played in each venue along with their city.

What is the difficulty level of this exercise?



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