w3resource logo
Soccer Database Exercises

SQL exercises on soccer Database: Basic - Exercises, Practice, Solution

SQL [29 exercises with solution]

Sample Database: soccer

soccer database relationship structure

1. Write a query in SQL to find the number of venues for EURO cup 2016.  Go to the editor

Sample table: soccer_venue


Click me to see the solution

2. Write a query in SQL to find the number countries participated in the EURO cup 2016.  Go to the editor

Sample table: soccer_venue


Click me to see the solution

3. Write a query in SQL to find the number goals scored in EURO cup 2016 within normal play schedule.  Go to the editor

Sample table: goal_details


Click me to see the solution

4. Write a query in SQL to find the number of matches ended with a result.  Go to the editor

Sample table: match_mast


Click me to see the solution

5. Write a query in SQL to find the number of matches ended with draws.  Go to the editor

Sample table: match_mast


Click me to see the solution

6. Write a query in SQL to find the date when did Football EURO cup 2016 begin.  Go to the editor

Sample table: match_mast


Click me to see the solution

7. Write a query in SQL to find the number of self-goals scored in EURO cup 2016.  Go to the editor

Sample table: goal_details


Click me to see the solution

8. Write a query in SQL to count the number of matches ended with a results in group stage.  Go to the editor

Sample table: match_mast


Click me to see the solution

9. Write a query in SQL to find the number of matches got a result by penalty shootout.  Go to the editor

Sample table: penalty_shootout


Click me to see the solution

10. Write a query in SQL to find the number of matches were decided on penalties in the Round of 16.  Go to the editor

Sample table: match_mast


Click me to see the solution

11. Write a query in SQL to find the number of goal scored in every match within normal play schedule.  Go to the editor

Sample table: goal_details


Click me to see the solution

12. Write a query in SQL to find the match no, date of play, and goal scored for that match in which no stoppage time have been added in 1st half of play.  Go to the editor

Sample table: goal_details


Click me to see the solution

13. Write a query in SQL to find the number of matches ending with a goalless draw in group stage of play.  Go to the editor

Sample table: match_details


Click me to see the solution

14. Write a query in SQL to find the number of matches ending with only one goal win except those matches which was decided by penalty shootout.  Go to the editor

Sample table: match_details


Click me to see the solution

15. Write a query in SQL to find the total number of players replaced in the tournament.  Go to the editor

Sample table: player_in_out


Click me to see the solution

16. Write a query in SQL to find the total number of palyers replaced within normal time of play.  Go to the editor

Sample table: player_in_out


Click me to see the solution

17. Write a query in SQL to find the number of players replaced in the stoppage time.  Go to the editor

Sample table: player_in_out


Click me to see the solution

18. Write a query in SQL to find the total number of players replaced in the first half of play.  Go to the editor

Sample table: player_in_out


Click me to see the solution

19. Write a query in SQL to find the total number of goalless draws have there in the entire tournament.  Go to the editor

Sample table: match_details


Click me to see the solution

20. Write a query in SQL to fine the total number of players replaced in the extra time of play.  Go to the editor

Sample table: player_in_out


Click me to see the solution

21. Write a query in SQL to compute a list to show the number of substitute happened in various stage of play for the entire tournament.  Go to the editor

Sample table: player_in_out


Click me to see the solution

22. Write a query in SQL to find the number of shots taken in penalty shootout matches.  Go to the editor

Sample table: penalty_shootout


Click me to see the solution

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

Sample table: penalty_shootout


Click me to see the solution

24. Write a query in SQL to find the number of shots missed or saved in penalty shootout matches.  Go to the editor

Sample table: penalty_shootout


Click me to see the solution

25. Write a query in SQL to prepare a list of players with number of shots they taken in penalty shootout matches.  Go to the editor

Sample table: soccer_country


Sample table: penalty_shootout


Sample table: player_mast


Click me to see the solution

26. Write a query in SQL to find the number of penalty shots taken by the teams.  Go to the editor

Sample table: soccer_country


Sample table: penalty_shootout


Click me to see the solution

27. Write a query in SQL to find the number of booking happened in each half of play within normal play schedule.  Go to the editor

Sample table: player_booked


Click me to see the solution

28. Write a query in SQL to find the number of booking happened in stoppage time.  Go to the editor

Sample table: player_booked


Click me to see the solution

29. Write a query in SQL to find the number of booking happened in extra time.  Go to the editor

Sample table: player_booked


Click me to see the solution

More to come .......

Practice Online


More to Come !

Do not submit any solution of the above exercises at here, if you want to contribute go to the appropriate exercise page.