w3resource
Soccer Database Exercises

SQL Subqueries exercises on soccer Database: Find the date when penalty shootout matches played

SQL soccer Database: Subqueries Exercise-32 with Solution

Write a query in SQL to find the date when penalty shootout matches played.

Sample table: match_mast


Sample table: penalty_shootout


Sample Solution:

SQL Code:

SELECT play_date
FROM match_mast
WHERE match_no IN
    (SELECT DISTINCT match_no
     FROM penalty_shootout);

Sample Output:

 play_date
------------
 2016-07-03
 2016-07-01
 2016-06-25
(3 rows)

Query Visualization:

Duration:

Query visualization of Find the date when penalty shootout matches played - Duration

Rows:

Query visualization of Find the date when penalty shootout matches played - Rows

Cost:

Query visualization of Find the date when 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 venues where penalty shootout matches played.
Next: Write a query in SQL to find the most quickest goal at the EURO cup 2016, after 5 minutes.

What is the difficulty level of this exercise?



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