Question
The query below displays the name and region of all countries which do not have any cities with population over 5,000,000. The query is copied
The query below displays the name and region of all countries which do not have any cities with population over 5,000,000. The query is copied below. Write another main query on top of it, to count these countries! Remove sorting, which is not needed for counting purposes. Expected result:
Query to be Adjusted:
SELECT name, region FROM world.country WHERE code NOT IN ( SELECT countrycode FROM world.city WHERE population > 5000000 ) ORDER BY name;
Expected Result:
The main query will contain a nested subquery (subquery inside of another subquery).
HINT
The main query will have the form SELECT COUNT(*) FROM (...).
Alias the result of the main query AS result;
count 221Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started