PRAGMA foreign_keys = ON;

PRAGMA writable_schema = 1;
DELETE FROM sqlite_master WHERE type IN ("table", "index", "trigger");
PRAGMA writable_schema = 0;
VACUUM;

CREATE TABLE "city" (
"ID" INT,
"Name" CHAR(35),
"CountryCode" CHAR(3),
"Population" INT,
PRIMARY KEY ("ID"),
FOREIGN KEY ("CountryCode") REFERENCES "country"("Code")
);

CREATE TABLE "country" (
"Code" CHAR(3),
"Name" CHAR(52),
"Continent" TEXT,
"Population" INT,
PRIMARY KEY ("Code")
);





INSERT INTO "country" VALUES ("USA", "United States", "North America", "331000000");
INSERT INTO "country" VALUES ("CAN", "Canada", "North America", "38000000");
INSERT INTO "country" VALUES ("MEX", "Mexico", "North America", "128000000");
INSERT INTO "country" VALUES ("BRA", "Brazil", "South America", "213000000");
INSERT INTO "country" VALUES ("ARG", "Argentina", "South America", "45000000");
INSERT INTO "country" VALUES ("GBR", "United Kingdom", "Europe", "67000000");
INSERT INTO "country" VALUES ("FRA", "France", "Europe", "65000000");
INSERT INTO "country" VALUES ("DEU", "Germany", "Europe", "83000000");
INSERT INTO "country" VALUES ("CHN", "China", "Asia", "1441000000");
INSERT INTO "country" VALUES ("IND", "India", "Asia", "1393000000");
INSERT INTO "country" VALUES ("AUS", "Australia", "Oceania", "25000000");
INSERT INTO "city" VALUES ("1", "New York", "USA", "8400000");
INSERT INTO "city" VALUES ("2", "Los Angeles", "USA", "3900000");
INSERT INTO "city" VALUES ("3", "Chicago", "USA", "2700000");
INSERT INTO "city" VALUES ("4", "Houston", "USA", "2300000");
INSERT INTO "city" VALUES ("5", "Phoenix", "USA", "1700000");
INSERT INTO "city" VALUES ("6", "Philadelphia", "USA", "1600000");
INSERT INTO "city" VALUES ("7", "San Antonio", "USA", "1500000");
INSERT INTO "city" VALUES ("8", "San Diego", "USA", "1400000");
INSERT INTO "city" VALUES ("9", "Dallas", "USA", "1300000");
INSERT INTO "city" VALUES ("10", "San Jose", "USA", "1000000");
INSERT INTO "city" VALUES ("11", "Austin", "USA", "960000");
INSERT INTO "city" VALUES ("12", "Jacksonville", "USA", "950000");
INSERT INTO "city" VALUES ("13", "Fort Worth", "USA", "930000");
INSERT INTO "city" VALUES ("14", "Columbus", "USA", "900000");
INSERT INTO "city" VALUES ("15", "Charlotte", "USA", "890000");
INSERT INTO "city" VALUES ("16", "Indianapolis", "USA", "880000");
INSERT INTO "city" VALUES ("17", "San Francisco", "USA", "870000");
INSERT INTO "city" VALUES ("18", "Seattle", "USA", "750000");
INSERT INTO "city" VALUES ("19", "Denver", "USA", "710000");
INSERT INTO "city" VALUES ("20", "Washington", "USA", "700000");
INSERT INTO "city" VALUES ("21", "Boston", "USA", "690000");
INSERT INTO "city" VALUES ("22", "El Paso", "USA", "680000");
INSERT INTO "city" VALUES ("23", "Nashville", "USA", "670000");
INSERT INTO "city" VALUES ("24", "Detroit", "USA", "630000");
INSERT INTO "city" VALUES ("25", "Oklahoma City", "USA", "660000");
INSERT INTO "city" VALUES ("26", "Portland", "USA", "650000");
INSERT INTO "city" VALUES ("27", "Las Vegas", "USA", "640000");
INSERT INTO "city" VALUES ("28", "Memphis", "USA", "630000");
INSERT INTO "city" VALUES ("29", "Louisville", "USA", "620000");
INSERT INTO "city" VALUES ("30", "Baltimore", "USA", "580000");
INSERT INTO "city" VALUES ("31", "Milwaukee", "USA", "590000");
INSERT INTO "city" VALUES ("32", "Albuquerque", "USA", "560000");
INSERT INTO "city" VALUES ("33", "Tucson", "USA", "540000");
INSERT INTO "city" VALUES ("34", "Fresno", "USA", "530000");
INSERT INTO "city" VALUES ("35", "Sacramento", "USA", "520000");
INSERT INTO "city" VALUES ("36", "Mesa", "USA", "510000");
INSERT INTO "city" VALUES ("37", "Kansas City", "USA", "500000");
INSERT INTO "city" VALUES ("38", "Atlanta", "USA", "490000");
INSERT INTO "city" VALUES ("39", "Long Beach", "USA", "460000");
INSERT INTO "city" VALUES ("40", "Colorado Springs", "USA", "480000");
INSERT INTO "city" VALUES ("41", "Raleigh", "USA", "470000");
INSERT INTO "city" VALUES ("42", "Miami", "USA", "450000");
INSERT INTO "city" VALUES ("43", "Virginia Beach", "USA", "450000");
INSERT INTO "city" VALUES ("44", "Omaha", "USA", "480000");
INSERT INTO "city" VALUES ("45", "Oakland", "USA", "440000");
INSERT INTO "city" VALUES ("46", "Minneapolis", "USA", "430000");
INSERT INTO "city" VALUES ("47", "Tulsa", "USA", "410000");
INSERT INTO "city" VALUES ("48", "Arlington", "USA", "400000");
INSERT INTO "city" VALUES ("49", "New Orleans", "USA", "390000");
INSERT INTO "city" VALUES ("50", "Wichita", "USA", "390000");
INSERT INTO "city" VALUES ("51", "Cleveland", "USA", "370000");
INSERT INTO "city" VALUES ("52", "Bakersfield", "USA", "380000");
INSERT INTO "city" VALUES ("53", "Aurora", "USA", "380000");
INSERT INTO "city" VALUES ("54", "Anaheim", "USA", "350000");
INSERT INTO "city" VALUES ("55", "Honolulu", "USA", "350000");
INSERT INTO "city" VALUES ("56", "Santa Ana", "USA", "330000");
INSERT INTO "city" VALUES ("57", "Riverside", "USA", "330000");
INSERT INTO "city" VALUES ("58", "Corpus Christi", "USA", "320000");
INSERT INTO "city" VALUES ("59", "Lexington", "USA", "320000");
INSERT INTO "city" VALUES ("60", "Stockton", "USA", "310000");
INSERT INTO "city" VALUES ("61", "St. Louis", "USA", "300000");
INSERT INTO "city" VALUES ("62", "Pittsburgh", "USA", "300000");
INSERT INTO "city" VALUES ("63", "Cincinnati", "USA", "300000");
INSERT INTO "city" VALUES ("64", "Anchorage", "USA", "290000");
INSERT INTO "city" VALUES ("65", "Henderson", "USA", "320000");
INSERT INTO "city" VALUES ("66", "Greensboro", "USA", "290000");
INSERT INTO "city" VALUES ("67", "Plano", "USA", "290000");
INSERT INTO "city" VALUES ("68", "Newark", "USA", "280000");
INSERT INTO "city" VALUES ("69", "Orlando", "USA", "280000");
INSERT INTO "city" VALUES ("70", "Lincoln", "USA", "290000");
INSERT INTO "city" VALUES ("71", "Toledo", "USA", "270000");
INSERT INTO "city" VALUES ("72", "Fort Wayne", "USA", "270000");
INSERT INTO "city" VALUES ("73", "Jersey City", "USA", "260000");
INSERT INTO "city" VALUES ("74", "St. Petersburg", "USA", "260000");
INSERT INTO "city" VALUES ("75", "Chula Vista", "USA", "270000");
INSERT INTO "city" VALUES ("76", "Buffalo", "USA", "250000");
INSERT INTO "city" VALUES ("77", "Durham", "USA", "280000");
INSERT INTO "city" VALUES ("78", "Madison", "USA", "260000");
INSERT INTO "city" VALUES ("79", "Fort Lauderdale", "USA", "180000");
INSERT INTO "city" VALUES ("80", "Scottsdale", "USA", "220000");
INSERT INTO "city" VALUES ("81", "Hialeah", "USA", "230000");
INSERT INTO "city" VALUES ("82", "Chesapeake", "USA", "240000");
INSERT INTO "city" VALUES ("83", "Lubbock", "USA", "260000");
INSERT INTO "city" VALUES ("84", "Reno", "USA", "260000");
INSERT INTO "city" VALUES ("85", "Akron", "USA", "190000");
INSERT INTO "city" VALUES ("86", "Glendale", "USA", "200000");
INSERT INTO "city" VALUES ("87", "Winston-Salem", "USA", "250000");
INSERT INTO "city" VALUES ("88", "North Las Vegas", "USA", "270000");
INSERT INTO "city" VALUES ("89", "Irvine", "USA", "280000");
INSERT INTO "city" VALUES ("90", "Rochester", "USA", "210000");
INSERT INTO "city" VALUES ("91", "Fremont", "USA", "230000");
INSERT INTO "city" VALUES ("92", "Boise", "USA", "240000");
INSERT INTO "city" VALUES ("93", "San Bernardino", "USA", "220000");
INSERT INTO "city" VALUES ("94", "Spokane", "USA", "220000");
INSERT INTO "city" VALUES ("95", "Richmond", "USA", "230000");
INSERT INTO "city" VALUES ("96", "Yonkers", "USA", "210000");
INSERT INTO "city" VALUES ("97", "Montgomery", "USA", "200000");
INSERT INTO "city" VALUES ("98", "Des Moines", "USA", "210000");
INSERT INTO "city" VALUES ("99", "Shreveport", "USA", "180000");
INSERT INTO "city" VALUES ("100", "Augusta", "USA", "200000");
INSERT INTO "city" VALUES ("101", "Grand Rapids", "USA", "190000");
INSERT INTO "city" VALUES ("102", "Tallahassee", "USA", "190000");
INSERT INTO "city" VALUES ("103", "Mobile", "USA", "180000");
INSERT INTO "city" VALUES ("104", "Knoxville", "USA", "190000");
INSERT INTO "city" VALUES ("105", "Worcester", "USA", "200000");
INSERT INTO "city" VALUES ("106", "Vancouver", "CAN", "630000");
INSERT INTO "city" VALUES ("107", "Montreal", "CAN", "1700000");
INSERT INTO "city" VALUES ("108", "Toronto", "CAN", "2900000");
INSERT INTO "city" VALUES ("109", "Calgary", "CAN", "1300000");
INSERT INTO "city" VALUES ("110", "Ottawa", "CAN", "1000000");
INSERT INTO "city" VALUES ("111", "Mexico City", "MEX", "9200000");
INSERT INTO "city" VALUES ("112", "Guadalajara", "MEX", "1400000");
INSERT INTO "city" VALUES ("113", "Monterrey", "MEX", "1100000");
INSERT INTO "city" VALUES ("114", "Puebla", "MEX", "1600000");
INSERT INTO "city" VALUES ("115", "Rio de Janeiro", "BRA", "6700000");
INSERT INTO "city" VALUES ("116", "Sao Paulo", "BRA", "12300000");
INSERT INTO "city" VALUES ("117", "Brasilia", "BRA", "3000000");
INSERT INTO "city" VALUES ("118", "Buenos Aires", "ARG", "3000000");
INSERT INTO "city" VALUES ("119", "Cordoba", "ARG", "1300000");
INSERT INTO "city" VALUES ("120", "London", "GBR", "9000000");
INSERT INTO "city" VALUES ("121", "Birmingham", "GBR", "1100000");
INSERT INTO "city" VALUES ("122", "Manchester", "GBR", "550000");
INSERT INTO "city" VALUES ("123", "Paris", "FRA", "2100000");
INSERT INTO "city" VALUES ("124", "Marseille", "FRA", "870000");
INSERT INTO "city" VALUES ("125", "Lyon", "FRA", "520000");
INSERT INTO "city" VALUES ("126", "Berlin", "DEU", "3700000");
INSERT INTO "city" VALUES ("127", "Hamburg", "DEU", "1800000");
INSERT INTO "city" VALUES ("128", "Munich", "DEU", "1500000");
INSERT INTO "city" VALUES ("129", "Shanghai", "CHN", "26000000");
INSERT INTO "city" VALUES ("130", "Beijing", "CHN", "21000000");
INSERT INTO "city" VALUES ("131", "Chongqing", "CHN", "32000000");
INSERT INTO "city" VALUES ("132", "Delhi", "IND", "19000000");
INSERT INTO "city" VALUES ("133", "Mumbai", "IND", "20000000");
INSERT INTO "city" VALUES ("134", "Bangalore", "IND", "13000000");
INSERT INTO "city" VALUES ("135", "Sydney", "AUS", "5300000");
INSERT INTO "city" VALUES ("136", "Melbourne", "AUS", "5000000");
INSERT INTO "city" VALUES ("137", "Brisbane", "AUS", "2500000");
INSERT INTO "city" VALUES ("138", "Adelaide", "AUS", "1300000");
INSERT INTO "city" VALUES ("139", "Perth", "AUS", "2100000");
INSERT INTO "city" VALUES ("140", "Canberra", "AUS", "460000");
INSERT INTO "city" VALUES ("141", "Gold Coast", "AUS", "690000");
INSERT INTO "city" VALUES ("142", "Newcastle", "AUS", "320000");
INSERT INTO "city" VALUES ("143", "Wollongong", "AUS", "300000");
INSERT INTO "city" VALUES ("144", "Geelong", "AUS", "200000");
INSERT INTO "city" VALUES ("145", "Hobart", "AUS", "240000");
INSERT INTO "city" VALUES ("146", "Townsville", "AUS", "180000");
INSERT INTO "city" VALUES ("147", "Cairns", "AUS", "150000");
INSERT INTO "city" VALUES ("148", "Darwin", "AUS", "140000");
INSERT INTO "city" VALUES ("149", "Launceston", "AUS", "110000");
INSERT INTO "city" VALUES ("150", "Alice Springs", "AUS", "25000");