Question: Write queries (using SQL Commands) to answer the following questions based on Oralce Apex SQL: a. List all information about countries in the region Oceania
Write queries (using SQL Commands) to answer the following questions based on Oralce Apex SQL:
a. List all information about countries in the region Oceania and sort results from most populous to least populous.
b. How many countries are in the Arctic or World regions? Show this number.
c. List the names of the countries that satisfy ALL of the following criteria: population greater than 50 million, not in Middle East or Africa, andarea less than 1 million km2.
d. List the regions (no repeats) containing countries with a negative change in GDP.
COUNTRY table
Name: Country name, text string with maximum 50 characters (primary key)
Region: Geographic region ofcountry (e.g., South America), text string with maximum 60 characters
Area: Area of country in km2, integer with up to 10 digits
Population: Population of country, integer with up to 11 digits
GDP: Gross domestic product growth in 2011 (e.g. 0.1=10%), number
CREATE TABLE COUNTRY ( Name varchar2(50), Region varchar2(60), Area number(10,0), Population number(11,0), GDP number, CONSTRAINT COUNTRY_PK primary key (Name)
INSERT INTO COUNTRY (Name,Region,Area,Population,GDP) VALUES ('Andorra','Europe',450,84825,.038); INSERT INTO COUNTRY (Name,Region,Area,Population,GDP) VALUES ('Angola','Africa',1246700,13338541,.016); INSERT INTO COUNTRY (Name,Region,Area,Population,GDP) VALUES ('Anguilla','Central America and the Caribbean',91,15094,-.085); INSERT INTO COUNTRY (Name,Region,Area,Population,GDP) VALUES ('Argentina','South America',2766890,41769726,.075); INSERT INTO COUNTRY (Name,Region,Area,Population,GDP) VALUES ('Aruba','Central America and the Caribbean',193,106113,.024); INSERT INTO COUNTRY (Name,Region,Area,Population,GDP) VALUES ('Australia','Oceania',7686850,21766711,.027); INSERT INTO COUNTRY (Name,Region,Area,Population,GDP) VALUES ('Afghanistan','Asia',647500,29835392,.082); INSERT INTO COUNTRY (Name,Region,Area,Population,GDP) VALUES ('Albania','Ethnic Groups in Eastern Europe, Europe',28750,2994667,.035); INSERT INTO COUNTRY (Name,Region,Area,Population,GDP) VALUES ('Algeria','Africa',2381740,34994937,.033); INSERT INTO COUNTRY (Name,Region,Area,Population,GDP) VALUES ('American Samoa','Oceania',199,67242,.03); INSERT INTO COUNTRY (Name,Region,Area,Population,GDP) VALUES ('Bermuda','North America',50,68679,.046); INSERT INTO COUNTRY (Name,Region,Area,Population,GDP) VALUES ('Bhutan','Asia',47000,708427,.067); INSERT INTO COUNTRY (Name,Region,Area,Population,GDP) VALUES ('Bolivia','South America',1098580,10118683,.042); INSERT INTO COUNTRY (Name,Region,Area,Population,GDP) VALUES ('Botswana','Africa',600370,2065398,.086); INSERT INTO COUNTRY (Name,Region,Area,Population,GDP) VALUES ('Brazil','South America',8511965,203429773,.075); INSERT INTO COUNTRY (Name,Region,Area,Population,GDP) VALUES ('Bulgaria','Ethnic Groups in Eastern Europe, Europe',110910,7093635,.002); INSERT INTO COUNTRY (Name,Region,Area,Population,GDP) VALUES ('Burundi','Africa',27830,10216190,.039); INSERT INTO COUNTRY (Name,Region,Area,Population,GDP) VALUES ('Cambodia','Southeast Asia',181040,14701717,.06); INSERT INTO COUNTRY (Name,Region,Area,Population,GDP) VALUES ('Cameroon','Africa',475440,19711291,.03); INSERT INTO COUNTRY (Name,Region,Area,Population,GDP) VALUES ('Austria','Europe',83850,8217280,.02); INSERT INTO COUNTRY (Name,Region,Area,Population,GDP) VALUES ('Bahrain','Middle East',620,1214705,.041); INSERT INTO COUNTRY (Name,Region,Area,Population,GDP) VALUES ('Bangladesh','Asia',144000,158570535,.06); INSERT INTO COUNTRY (Name,Region,Area,Population,GDP) VALUES ('Barbados','Central America and the Caribbean',430,286705,-.005); INSERT INTO COUNTRY (Name,Region,Area,Population,GDP) VALUES ('Belgium','Europe',30510,10431477,.02); INSERT INTO COUNTRY (Name,Region,Area,Population,GDP) VALUES ('Belize','Central America and the Caribbean',22960,321115,.02); INSERT INTO COUNTRY (Name,Region,Area,Population,GDP) VALUES ('Benin','Africa',112620,9325032,.025); INSERT INTO COUNTRY (Name,Region,Area,Population,GDP) VALUES ('Canada','North America',9976140,34030589,.031); INSERT INTO COUNTRY (Name,Region,Area,Population,GDP) VALUES ('Cape Verde','World',4030,516100,.054); INSERT INTO COUNTRY (Name,Region,Area,Population,GDP) VALUES ('Cayman Islands','Central America and the Caribbean',260,51384,.011); INSERT INTO COUNTRY (Name,Region,Area,Population,GDP) VALUES ('Cocos (Keeling) Islands','Southeast Asia',14,596,.01); INSERT INTO COUNTRY (Name,Region,Area,Population,GDP) VALUES ('Comoros','Africa',2170,794683,.021); INSERT INTO COUNTRY (Name,Region,Area,Population,GDP) VALUES ('Cook Islands','Oceania',240,11124,.001); INSERT INTO COUNTRY (Name,Region,Area,Population,GDP) VALUES ('Costa Rica','Central America and the Caribbean',51100,4576562,.042); INSERT INTO COUNTRY (Name,Region,Area,Population,GDP) VALUES ('Croatia','Ethnic Groups in Eastern Europe, Europe',56538,4483804,-.014); INSERT INTO COUNTRY (Name,Region,Area,Population,GDP) VALUES ('Cuba','Central America and the Caribbean',110860,11087330,.015); INSERT INTO COUNTRY (Name,Region,Area,Population,GDP) VALUES ('Cyprus','Middle East',9250,1120489,.01); INSERT INTO COUNTRY (Name,Region,Area,Population,GDP) VALUES ('Czech Republic','Ethnic Groups in Eastern Europe, Europe',78703,10190213,.023); INSERT INTO COUNTRY (Name,Region,Area,Population,GDP) VALUES ('Denmark','Europe',43070,5529888,.021); INSERT INTO COUNTRY (Name,Region,Area,Population,GDP) VALUES ('Djibouti','Africa',22000,757074,.045); INSERT INTO COUNTRY (Name,Region,Area,Population,GDP) VALUES ('Central African Republic','Africa',622980,4950027,.033); INSERT INTO COUNTRY (Name,Region,Area,Population,GDP) VALUES ('Chad','Africa',1284000,10758945,.051); INSERT INTO COUNTRY (Name,Region,Area,Population,GDP) VALUES ('Chile','South America',756950,16888760,.053); INSERT INTO COUNTRY (Name,Region,Area,Population,GDP) VALUES ('China','Asia',9596960,1336718015,.103); INSERT INTO COUNTRY (Name,Region,Area,Population,GDP) VALUES ('Faroe Islands','Europe',1400,49267,.005); INSERT INTO COUNTRY (Name,Region,Area,Population,GDP) VALUES ('Fiji','Oceania',18270,883125,.001); INSERT INTO COUNTRY (Name,Region,Area,Population,GDP) VALUES ('Finland','Europe',337030,5259250,.031); INSERT INTO COUNTRY (Name,Region,Area,Population,GDP) VALUES ('France','Europe',547030,65312249,.015); INSERT INTO COUNTRY (Name,Region,Area,Population,GDP) VALUES ('French Polynesia','Oceania',3941,294935,.027); INSERT INTO COUNTRY (Name,Region,Area,Population,GDP) VALUES ('Gabon','Africa',267670,1576665,.057); INSERT INTO COUNTRY (Name,Region,Area,Population,GDP) VALUES ('Georgia','Middle East',69700,4585874,.064); INSERT INTO COUNTRY (Name,Region,Area,Population,GDP) VALUES ('Germany','Europe',356910,81471834,.035); INSERT INTO COUNTRY (Name,Region,Area,Population,GDP) VALUES ('Ghana','Africa',238540,24791073,.057); INSERT INTO COUNTRY (Name,Region,Area,Population,GDP) VALUES ('Dominica','Central America and the Caribbean',750,72969,.01); INSERT INTO COUNTRY (Name,Region,Area,Population,GDP) VALUES ('Dominican Republic','Central America and the Caribbean',48730,9956648,.078); INSERT INTO COUNTRY (Name,Region,Area,Population,GDP) VALUES ('Ecuador','South America',283560,15007343,.032); INSERT INTO COUNTRY (Name,Region,Area,Population,GDP) VALUES ('Egypt','Africa',1001450,82079636,.051); INSERT INTO COUNTRY (Name,Region,Area,Population,GDP) VALUES ('El Salvador','Central America and the Caribbean',21040,6071774,.007); INSERT INTO COUNTRY (Name,Region,Area,Population,GDP) VALUES ('Equatorial Guinea','Africa',28050,668225,-.008); INSERT INTO COUNTRY (Name,Region,Area,Population,GDP) VALUES ('Eritrea','Africa',121320,5939484,.022); INSERT INTO COUNTRY (Name,Region,Area,Population,GDP) VALUES ('Estonia','Europe',45100,1282963,.031); INSERT INTO COUNTRY (Name,Region,Area,Population,GDP) VALUES ('Ethiopia','Africa',1127127,90873739,.08); INSERT INTO COUNTRY (Name,Region,Area,Population,GDP) VALUES ('Greece','Europe',131940,10760136,-.045); INSERT INTO COUNTRY (Name,Region,Area,Population,GDP) VALUES ('Greenland','Arctic Region',2175600,57670,-.02); INSERT INTO COUNTRY (Name,Region,Area,Population,GDP) VALUES ('Haiti','Central America and the Caribbean',27750,9719932,-.051); INSERT INTO COUNTRY (Name,Region,Area,Population,GDP) VALUES ('Honduras','Central America and the Caribbean',112090,8143564,.028); INSERT INTO COUNTRY (Name,Region,Area,Population,GDP) VALUES ('Hong Kong','Southeast Asia',1040,7122508,.068); INSERT INTO COUNTRY (Name,Region,Area,Population,GDP) VALUES ('Hungary','Ethnic Groups in Eastern Europe, Europe',93030,9976062,.012); INSERT INTO COUNTRY (Name,Region,Area,Population,GDP) VALUES ('Iceland','Arctic Region',103000,311058,-.035); INSERT INTO COUNTRY (Name,Region,Area,Population,GDP) VALUES ('India','Asia',3287590,1189172906,.104); INSERT INTO COUNTRY (Name,Region,Area,Population,GDP) VALUES ('Indonesia','Southeast Asia',1919440,245613043,.061); INSERT INTO COUNTRY (Name,Region,Area,Population,GDP) VALUES ('Iran','Middle East',1648000,77891220,.01); INSERT INTO COUNTRY (Name,Region,Area,Population,GDP) VALUES ('Iraq','Middle East',437072,30399572,.008); INSERT INTO COUNTRY (Name,Region,Area,Population,GDP) VALUES ('Grenada','Central America and the Caribbean',340,108419,-.014); INSERT INTO COUNTRY (Name,Region,Area,Population,GDP) VALUES ('Guadeloupe','Central America and the Caribbean',1780, NULL,NULL); INSERT INTO COUNTRY (Name,Region,Area,Population,GDP) VALUES ('Guatemala','Central America and the Caribbean',108890,13824463,.026); INSERT INTO COUNTRY (Name,Region,Area,Population,GDP) VALUES ('Guinea','Africa',245860,10601009,.019); INSERT INTO COUNTRY (Name,Region,Area,Population,GDP) VALUES ('Guyana','South America',214970,744768,.036); INSERT INTO COUNTRY (Name,Region,Area,Population,GDP) VALUES ('Latvia','Europe',64100,2204708,-.003); INSERT INTO COUNTRY (Name,Region,Area,Population,GDP) VALUES ('Lebanon','Middle East',10400,4143101,.075); INSERT INTO COUNTRY (Name,Region,Area,Population,GDP) VALUES ('Lesotho','Africa',30350,1924886,.024); INSERT INTO COUNTRY (Name,Region,Area,Population,GDP) VALUES ('Liberia','Africa',111370,3786764,.051); INSERT INTO COUNTRY (Name,Region,Area,Population,GDP) VALUES ('Liechtenstein','Europe',160,35236,.018); INSERT INTO COUNTRY (Name,Region,Area,Population,GDP) VALUES ('Lithuania','Europe',65200,3535547,.013); INSERT INTO COUNTRY (Name,Region,Area,Population,GDP) VALUES ('Luxembourg','Europe',2586,503302,.034); INSERT INTO COUNTRY (Name,Region,Area,Population,GDP) VALUES ('Madagascar','Africa',587040,21926221,-.02); INSERT INTO COUNTRY (Name,Region,Area,Population,GDP) VALUES ('Malawi','Africa',118480,15879252,.066); INSERT INTO COUNTRY (Name,Region,Area,Population,GDP) VALUES ('Ireland','Europe',70280,4670976,-.01); INSERT INTO COUNTRY (Name,Region,Area,Population,GDP) VALUES ('Israel','Middle East',20770,7473052,.046); INSERT INTO COUNTRY (Name,Region,Area,Population,GDP) VALUES ('Italy','Europe',301230,61016804,.013); INSERT INTO COUNTRY (Name,Region,Area,Population,GDP) VALUES ('Jamaica','Central America and the Caribbean',10990,2868380,-.011); INSERT INTO COUNTRY (Name,Region,Area,Population,GDP) VALUES ('Japan','Asia',377835,126475664,.039); INSERT INTO COUNTRY (Name,Region,Area,Population,GDP) VALUES ('Jordan','Middle East',89213,6508271,.031); INSERT INTO COUNTRY (Name,Region,Area,Population,GDP) VALUES ('Kenya','Africa',582650,41070934,.05); INSERT INTO COUNTRY (Name,Region,Area,Population,GDP) VALUES ('Kuwait','Middle East',17820,2595628,.02); INSERT INTO COUNTRY (Name,Region,Area,Population,GDP) VALUES ('Malaysia','Southeast Asia',329750,28728607,.072); INSERT INTO COUNTRY (Name,Region,Area,Population,GDP) VALUES ('Maldives','Asia',300,394999,.08); INSERT INTO COUNTRY (Name,Region,Area,Population,GDP) VALUES ('Mexico','North America',1972550,113724226,.055); INSERT INTO COUNTRY (Name,Region,Area,Population,GDP) VALUES ('Monaco','Europe',2,30539, NULL); INSERT INTO COUNTRY (Name,Region,Area,Population,GDP) VALUES ('Mongolia','Asia',1566000,3133318,.061); INSERT INTO COUNTRY (Name,Region,Area,Population,GDP) VALUES ('Montserrat','Central America and the Caribbean',100,5140,-.01); INSERT INTO COUNTRY (Name,Region,Area,Population,GDP) VALUES ('Morocco','Africa',446550,31968361,.032); INSERT INTO COUNTRY (Name,Region,Area,Population,GDP) VALUES ('Mozambique','Africa',801590,22948858,.07); INSERT INTO COUNTRY (Name,Region,Area,Population,GDP) VALUES ('Namibia','Africa',825418,2147585,.044); INSERT INTO COUNTRY (Name,Region,Area,Population,GDP) VALUES ('Nepal','Asia',140800,29391883,.046); INSERT INTO COUNTRY (Name,Region,Area,Population,GDP) VALUES ('Netherlands','Europe',37330,16847007,.017); INSERT INTO COUNTRY (Name,Region,Area,Population,GDP) VALUES ('Mali','Africa',1240000,14159904,.045); INSERT INTO COUNTRY (Name,Region,Area,Population,GDP) VALUES ('Malta','Europe',320,408333,.037); INSERT INTO COUNTRY (Name,Region,Area,Population,GDP) VALUES ('Marshall Islands','Oceania',181,67182,-.003); INSERT INTO COUNTRY (Name,Region,Area,Population,GDP) VALUES ('Mauritania','Africa',1030700,3281634,.047); INSERT INTO COUNTRY (Name,Region,Area,Population,GDP) VALUES ('Mauritius','World',1860,1303717,.04); INSERT INTO COUNTRY (Name,Region,Area,Population,GDP) VALUES ('Pakistan','Asia',803940,187342721,.048); INSERT INTO COUNTRY (Name,Region,Area,Population,GDP) VALUES ('Palau','Oceania',458,20956,NULL); INSERT INTO COUNTRY (Name,Region,Area,Population,GDP) VALUES ('Panama','Central America and the Caribbean',78200,3460462,.075); INSERT INTO COUNTRY (Name,Region,Area,Population,GDP) VALUES ('Papua New Guinea','Oceania',461690,6187591,.07);
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
