w3resource
Soccer Database Exercises

SQL exercises on soccer Database: Find the teams played the first match of EURO cup 2016

SQL soccer Database: Subqueries Exercise-1 with Solution

1. Write a query in SQL to find the teams played the first match of EURO cup 2016.

Sample table: match_details


Sample table: soccer_country


Sample Solution:

SQL Code:

SELECT match_no,country_name
FROM match_details a, soccer_country b
WHERE a.team_id=b.country_id
AND a.match_no=1;

Sample Output:

 match_no | country_name
----------+--------------
        1 | France
        1 | Romania
(2 rows)

Query Visualization:

Duration:

Query visualization of Find the teams played the first match of EURO cup 2016 - Duration

Rows:

Query visualization of Find the teams played the first match of EURO cup 2016 - Rows

Cost:

Query visualization of Find the teams played the first match of EURO cup 2016 - 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: SQL SUBQUERIES Exercises on Soccer Database
Next: Write a query in SQL to find the winner of EURO cup 2016.

What is the difficulty level of this exercise?



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