w3resource
Soccer Database Exercises

SQL exercises on soccer Database: Find the 2nd highest stoppage time which had been added in 2nd half of play

SQL soccer Database: Subqueries Exercise-9 with Solution

9. Write a query in SQL to find the 2nd highest stoppage time which had been added in 2nd half of play.

Sample table: match_mast


Sample Solution:

SQL Code:

SELECT MAX(stop2_sec) 
FROM match_mast
WHERE stop2_sec<>(
SELECT MAX(stop2_sec) 
FROM match_mast);

Sample Output:

 max
-----
 374
(1 row)

Query Visualization:

Duration:

Query visualization of Find the 2nd highest stoppage time which had been added in 2nd half of play - Duration

Rows:

Query visualization of Find the 2nd highest stoppage time which had been added in 2nd half of play - Rows

Cost:

Query visualization of Find the 2nd highest stoppage time which had been added in 2nd half of play - 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 player who scored the last goal for Portugal against Hungary.
Next: Write a query in SQL to find the teams played the match where 2nd highest stoppage time had been added in 2nd half of play.

What is the difficulty level of this exercise?



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