Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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:

image text in transcribed

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 221

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Fundamentals Study Guide

Authors: Dr. Sergio Pisano

1st Edition

B09K1WW84J, 979-8985115307

More Books

Students also viewed these Databases questions

Question

What is automation?

Answered: 1 week ago

Question

What documentation would you need to do performance analysis?

Answered: 1 week ago