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,
"Population" INT,
PRIMARY KEY ("ID")
);

CREATE TABLE "country" (
"Code" CHAR(3) UNIQUE,
"Name" CHAR(52),
"Continent" TEXT,
"Region" CHAR(26),
PRIMARY KEY ("Code")
);

CREATE TABLE "countrylanguage" (
"CountryCode" CHAR(3),
"Language" CHAR(30),
"IsOfficial" TEXT,
"Percentage" FLOAT,
PRIMARY KEY ("CountryCode", "Language"),
FOREIGN KEY ("CountryCode") REFERENCES "country"("Code")
);





INSERT INTO "city" VALUES ("1", "5000000");
INSERT INTO "city" VALUES ("2", "12000000");
INSERT INTO "city" VALUES ("3", "800000");
INSERT INTO "city" VALUES ("4", "3000000");
INSERT INTO "city" VALUES ("5", "1500000");
INSERT INTO "city" VALUES ("6", "700000");
INSERT INTO "city" VALUES ("7", "2000000");
INSERT INTO "city" VALUES ("8", "1000000");
INSERT INTO "city" VALUES ("9", "4000000");
INSERT INTO "city" VALUES ("10", "600000");
INSERT INTO "country" VALUES ("USA", "United States", "North America", "Northern America");
INSERT INTO "country" VALUES ("CAN", "Canada", "North America", "Northern America");
INSERT INTO "country" VALUES ("MEX", "Mexico", "North America", "Central America");
INSERT INTO "country" VALUES ("BRA", "Brazil", "South America", "South America");
INSERT INTO "country" VALUES ("ARG", "Argentina", "South America", "South America");
INSERT INTO "country" VALUES ("FRA", "France", "Europe", "Western Europe");
INSERT INTO "country" VALUES ("DEU", "Germany", "Europe", "Western Europe");
INSERT INTO "country" VALUES ("NGA", "Nigeria", "Africa", "Western Africa");
INSERT INTO "country" VALUES ("EGY", "Egypt", "Africa", "Northern Africa");
INSERT INTO "country" VALUES ("CHN", "China", "Asia", "Eastern Asia");
INSERT INTO "countrylanguage" VALUES ("USA", "English", "T", "82.1");
INSERT INTO "countrylanguage" VALUES ("USA", "Spanish", "F", "10.7");
INSERT INTO "countrylanguage" VALUES ("USA", "Chinese", "F", "1.2");
INSERT INTO "countrylanguage" VALUES ("CAN", "English", "T", "56.0");
INSERT INTO "countrylanguage" VALUES ("CAN", "French", "T", "21.0");
INSERT INTO "countrylanguage" VALUES ("CAN", "Punjabi", "F", "1.4");
INSERT INTO "countrylanguage" VALUES ("MEX", "Spanish", "T", "92.7");
INSERT INTO "countrylanguage" VALUES ("MEX", "Nahuatl", "F", "1.5");
INSERT INTO "countrylanguage" VALUES ("BRA", "Portuguese", "T", "97.9");
INSERT INTO "countrylanguage" VALUES ("BRA", "German", "F", "1.0");
INSERT INTO "countrylanguage" VALUES ("ARG", "Spanish", "T", "97.0");
INSERT INTO "countrylanguage" VALUES ("ARG", "Italian", "F", "1.5");
INSERT INTO "countrylanguage" VALUES ("FRA", "French", "T", "88.0");
INSERT INTO "countrylanguage" VALUES ("FRA", "Breton", "F", "1.2");
INSERT INTO "countrylanguage" VALUES ("FRA", "Alsatian", "F", "0.8");
INSERT INTO "countrylanguage" VALUES ("DEU", "German", "T", "95.0");
INSERT INTO "countrylanguage" VALUES ("DEU", "Sorbian", "F", "0.5");
INSERT INTO "countrylanguage" VALUES ("NGA", "English", "T", "53.0");
INSERT INTO "countrylanguage" VALUES ("NGA", "Hausa", "F", "30.0");
INSERT INTO "countrylanguage" VALUES ("NGA", "Yoruba", "F", "21.0");
INSERT INTO "countrylanguage" VALUES ("NGA", "Igbo", "F", "18.0");
INSERT INTO "countrylanguage" VALUES ("EGY", "Arabic", "T", "98.0");
INSERT INTO "countrylanguage" VALUES ("EGY", "English", "F", "2.0");
INSERT INTO "countrylanguage" VALUES ("CHN", "Chinese", "T", "91.0");
INSERT INTO "countrylanguage" VALUES ("CHN", "Tibetan", "F", "1.5");
INSERT INTO "countrylanguage" VALUES ("CHN", "Uighur", "F", "1.2");
INSERT INTO "countrylanguage" VALUES ("CHN", "Mongolian", "F", "0.8");