Revising the Select Query II
Last updated
Last updated
Query the NAME field for all American cities in the CITY table with populations larger than 120000
. The CountryCode for America is USA
.
The CITY table is described as follows:
Solution:
SELECT NAME FROM CITY WHERE population>120000 AND CountryCode = "USA";
Explanation:
SELECT NAME: This part of the query specifies that we only want to retrieve the names of the cities.
FROM CITY : This tells us that we're looking in the CITY table for the data.
WHERE population>120000: This condition filters the cities based on their population, only selecting those with populations greater than 120,000.
AND CountryCode = "USA" : This is another condition added to the WHERE clause. It specifies that we only want cities with the country code "USA".