SQL exercises on soccer Database: Find the player and his jersey number who scored the first penalty of the tournament
SQL soccer Database: Subqueries Exercise-14 with Solution
14. Write a query in SQL to find the player and his jersey number who scored the first penalty of the tournament.
Sample table: player_mast
Sample table: goal_details
SELECT player_name,jersey_no FROM player_mast WHERE player_id=( SELECT player_id FROM goal_details WHERE goal_type='P' AND match_no=( SELECT MIN(match_no) FROM goal_details WHERE goal_type='P' AND play_stage='G'));
player_name | jersey_no ----------------+----------- Bogdan Stancu | 19 (1 row)
Sample Database: soccer
Have another way to solve this solution? Contribute your code (and comments) through Disqus.
Previous: Write a query in SQL to find the club which supplied the most number of players to the 2016 EURO cup.
Next: Write a query in SQL to find the player along with his team and jersey number who scored the first penalty of the tournament.
What is the difficulty level of this exercise?
- New Content published on w3resource:
- Scala Programming Exercises, Practice, Solution
- Python Itertools exercises
- Python Numpy exercises
- Python GeoPy Package exercises
- Python Pandas exercises
- Python nltk exercises
- Python BeautifulSoup exercises
- Form Template
- Composer - PHP Package Manager
- PHPUnit - PHP Testing
- Laravel - PHP Framework