w3resource
Soccer Database Exercises

SQL Subqueries exercises on soccer Database: Find the most quickest goal at the EURO cup 2016, after 5 minutes

SQL soccer Database: Subqueries Exercise-33 with Solution

Write a query in SQL to find the most quickest goal at the EURO cup 2016, after 5 minutes.

Sample table: goal_details


Sample Solution:

SQL Code:

SELECT min(goal_time) AS "Most quickest goal after 5 minutes"
FROM
  (SELECT match_no,
          goal_time
   FROM goal_details
   WHERE goal_time>5
   GROUP BY match_no,
            goal_time
   ORDER BY goal_time) hh;

Sample Output:

 Most quickest goal after 5 minutes
------------------------------------
                                  6
(1 row)

Query Visualization:

Duration:

Query visualization of Find the most quickest goal at the EURO cup 2016, after 5 minutes - Duration

Rows:

Query visualization of Find the most quickest goal at the EURO cup 2016, after 5 minutes - Rows

Cost:

Query visualization of Find the most quickest goal at the EURO cup 2016, after 5 minutes - 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 date when penalty shootout matches played.
Next: SQL JOINS Exercises on Soccer Database

What is the difficulty level of this exercise?



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