w3resource
Soccer Database Exercises

SQL exercises on soccer Database: Find the players with other information under contract to Liverpool were in the Squad of England in 2016 EURO cup

SQL soccer Database: Subqueries Exercise-19 with Solution

19. Write a query in SQL to find the players with other information under contract to Liverpool were in the Squad of England in 2016 EURO cup.

Sample table: player_mast


Sample table: soccer_country


Sample Solution:

SQL Code:

SELECT player_name, jersey_no, posi_to_play, age
FROM player_mast 
WHERE playing_club='Liverpool'
AND team_id=(
SELECT country_id
FROM soccer_country
WHERE country_name='England'
);

Sample Output:

    player_name    | jersey_no | posi_to_play | age
-------------------+-----------+--------------+-----
 James Milner      |         4 | MF           |  30
 Adam Lallana      |         8 | MF           |  28
 Nathaniel Clyne   |        12 | DF           |  25
 Jordan Henderson  |        14 | MF           |  26
 Daniel Sturridge  |        15 | FD           |  26
(5 rows)

Query Visualization:

Duration:

Query visualization of Find the players with other information under contract to Liverpool were in the Squad of England in 2016 EURO cup - Duration

Rows:

Query visualization of Find the players with other information under contract to Liverpool were in the Squad of England in 2016 EURO cup - Rows

Cost:

Query visualization of Find the players with other information under contract to Liverpool were in the Squad of England in 2016 EURO cup - 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 players along with their jersey no., and playing club, who were the goalkeepers for the England squad for 2016 EURO cup.
Next: Write a query in SQL to find the player with other infromation Who scored the last goal in the 2nd semi final i.e. 50th match in EURO cub 2016.

What is the difficulty level of this exercise?



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