w3resource
Soccer Database Exercises

SQL exercises on soccer Database: Find the number of shots socred goal in penalty shootout matches

SQL soccer Database: Exercise-23 with Solution

23. Write a query in SQL to find the number of shots socred goal in penalty shootout matches.

Sample table: penalty_shootout


Sample Solution:

SQL Code:

SELECT COUNT(*) AS "Goal Scored by Penalty Kicks"
FROM penalty_shootout
WHERE score_goal='Y';

Sample Output:

 Goal Scored by Penalty Kicks
------------------------------
                           28
(1 row)

Query Visualization:

Duration:

Query visualization of Find the number of shots socred goal in penalty shootout matches - Duration

Rows:

Query visualization of Find the number of shots socred goal in penalty shootout matches - Rows

Cost:

Query visualization of Find the number of shots socred goal in penalty shootout matches - 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 number of shots taken in penalty shootout matches.
Next: Write a query in SQL to find the number of shots missed or saved in penalty shootout matches.

What is the difficulty level of this exercise?



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