AIncorrect Answer

The population attribute may not be used in such a grouped query.

close

BCorrect Answer

This will work. The continent field is OK as it is the "grouping" field, the population field has had a "agregating" function: SUM applied.

close

CIncorrect Answer

Neither of the fields name not population is permitted in a grouped query such as this.

close

DIncorrect Answer

The name field may not be used in a grouped query like this.

close

EIncorrect Answer

One of the options given IS valid SQL.

close

A B C D E TELL ME NEXT INDEX
 
 

Given a relation country(name, continent, population) which of the following is a valid SQL statement?

  1. SELECT continent, population FROM country GROUP BY continent
  2. SELECT continent, SUM(population) FROM country GROUP BY continent
  3. SELECT name, population FROM country GROUP BY continent

  4. SELECT name, SUM(population) FROM country GROUP BY continent
  5. None of the above OR more than one of the above