Sql - Select Within Select

  • October 2019
  • PDF

This document was uploaded by user and they confirmed that they have the permission to share it. If you are author or own the copyright of this book, please report to us by using this DMCA report form. Report DMCA


Overview

Download & View Sql - Select Within Select as PDF for free.

More details

  • Words: 261
  • Pages: 3
SELECT within SELECT 1a. List each country name where the population is larger than 'Russia' bbc(name, region, area, population, gdp) SELECT name FROM bbc WHERE population> (SELECT population FROM bbc WHERE name='Russia') NAME Bangladesh Brazil China India Indonesia Pakistan United States of America 1b. List the name and region of countries in the regions containing 'India', 'Iran'. select name, region from bbc where region in (select region from bbc where name in ('India' , 'Iran')) Well Done, that is correct. NAME

REGION Afghanistan South Asia Algeria Middle East Bahrain Middle East Bangladesh South Asia Bhutan South Asia Egypt Middle East India South Asia Iran Middle East Iraq Middle East Israel and Palestinian territories Middle East Jordan Middle East Kuwait Middle East Lebanon Middle East

Mauritania Morocco Nepal Oman Pakistan Qatar Saudi Arabia Sri Lanka Sudan Syria The Maldives Tunisia United Arab Emirates Yemen

Middle East Middle East South Asia Middle East South Asia Middle East Middle East South Asia Middle East Middle East South Asia Middle East Middle East Middle East

1c. Show the European countries with a per capita GDP greater than 'United Kingdom'. select name from bbc where region='Europe' and gdp / population > (select gdp/population from bbc where name ='United Kingdom') Well Done, that is correct. NAME Denmark Iceland Ireland Luxembourg Norway Sweden Switzerland

1d. Which country has a population that is more than Canada but less than Algeria?

select name from bbc where population > (select population from bbc where name='Canada') and population < (select population from bbc where name='Algeria') Well Done, that is correct. NAME Kenya

Related Documents

Sql - Select Within Select
October 2019 20
Bt Sql Select)
April 2020 6
Definiciones Select
April 2020 11
Instruction Select
June 2020 12
Select Doubleh
June 2020 2