﻿ SQL exercises on soccer Database: Find the teams who played the heighest audence match - w3resource

# SQL exercises on soccer Database: Find the teams who played the heighest audence match

## SQL soccer Database: Subqueries Exercise-7 with Solution

7. Write a query in SQL to find the teams who played the heighest audence match.

Sample table: soccer_country

Sample table: goal_details

Sample table: match_mast

Sample Solution:

SQL Code:

``````SELECT country_name
FROM soccer_country
WHERE country_id IN(
SELECT team_id
FROM goal_details
WHERE match_no=(
SELECT match_no
FROM match_mast
WHERE audence=(
SELECT max(audence)
FROM match_mast)
ORDER BY audence DESC));
```
```

Sample Output:

``` country_name
--------------
France
Iceland
(2 rows)
```

Duration:

Rows:

Cost:

## Practice Online

Sample Database: soccer

Have another way to solve this solution? Contribute your code (and comments) through Disqus.

What is the difficulty level of this exercise?

﻿

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