w3resource
Soccer Database Exercises

SQL Subqueries exercises on soccer Database: Find the venues where penalty shootout matches played

SQL soccer Database: Subqueries Exercise-31 with Solution

Write a query in SQL to find the venues where penalty shootout matches played.

Sample table: soccer_venue


Sample table: match_mast


Sample table: penalty_shootout


Sample Solution:

SQL Code:

SELECT venue_name
FROM soccer_venue
WHERE venue_id IN
    (SELECT venue_id
     FROM match_mast
     WHERE match_no IN
         (SELECT DISTINCT match_no
          FROM penalty_shootout));

Sample Output:

       venue_name
-------------------------
 Stade VElodrome
 Stade de Bordeaux
 Stade Geoffroy Guichard
(3 rows)

Query Visualization:

Duration:

Query visualization of Find the venues where penalty shootout matches played - Duration

Rows:

Query visualization of Find the venues where penalty shootout matches played - Rows

Cost:

Query visualization of Find the venues where penalty shootout matches played - Cost

SQL Code Editor:

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 stage of match where the penalty kick number 23 had been taken.
Next: Write a query in SQL to find the date when penalty shootout matches played.

What is the difficulty level of this exercise?



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