Which of the following queries will return a list of all countries that have a larger population than their continent’s average?

Consider the structure of the country table.

mysql> DESCRIBE Country;

Which of the following queries will return a list of all countries that have a larger population than their continent’s average?

Consider the structure of the country table.

mysql> DESCRIBE Country;

Which of the following queries will return a list of all countries that have a larger population than their continent’s average?

A.
SELECT Name, Continent, Population
FROM Country
WHERE Population > (SELECT AVG(Population)
FROM Country
WHERE Continent=Continent
GROUP BY Continent)

B.
SELECT Name, Continent, Population
FROM Country
WHERE Population > (SELECT AVG(Population)
FROM Country
WHERE inner.Continent=outer.Continent
GROUP BY Continent)

C.
SELECT Name, Continent, Population
FROM Country AS Cl
WHERE Population > (SELECT AVG(Population)
FROM Country
WHERE Cl.Continent=Continent
GROUP BY Continent)

D.
SELECT Name, Continent, Population
FROM Country AS Cl
WHERE Population > (SELECT AVG(Population)
FROM Country AS C2
WHERE Cl.Continent=C2.Continent
GROUP BY Continent)

E.
You cannot use the same table in the inner and outer query of a subquery.

Explanation:
A ambiguous names, B inner and outer are ???,



Leave a Reply 0

Your email address will not be published. Required fields are marked *