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,
"CountryCode" CHAR(3),
PRIMARY KEY ("ID"),
FOREIGN KEY ("CountryCode") REFERENCES "country"("Code")
);

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),
"Percentage" FLOAT,
PRIMARY KEY ("CountryCode", "Language"),
FOREIGN KEY ("CountryCode") REFERENCES "country"("Code")
);





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 ("FRA", "France", "Europe", "Western Europe");
INSERT INTO "country" VALUES ("DEU", "Germany", "Europe", "Western Europe");
INSERT INTO "country" VALUES ("JPN", "Japan", "Asia", "Eastern Asia");
INSERT INTO "country" VALUES ("CHN", "China", "Asia", "Eastern Asia");
INSERT INTO "country" VALUES ("IND", "India", "Asia", "Southern Asia");
INSERT INTO "country" VALUES ("BRA", "Brazil", "South America", "South America");
INSERT INTO "country" VALUES ("ARG", "Argentina", "South America", "South America");
INSERT INTO "city" VALUES ("1", "USA");
INSERT INTO "city" VALUES ("2", "USA");
INSERT INTO "city" VALUES ("3", "CAN");
INSERT INTO "city" VALUES ("4", "MEX");
INSERT INTO "city" VALUES ("5", "FRA");
INSERT INTO "city" VALUES ("6", "DEU");
INSERT INTO "city" VALUES ("7", "JPN");
INSERT INTO "city" VALUES ("8", "CHN");
INSERT INTO "city" VALUES ("9", "IND");
INSERT INTO "city" VALUES ("10", "BRA");
INSERT INTO "city" VALUES ("11", "ARG");
INSERT INTO "countrylanguage" VALUES ("USA", "English", "82.1");
INSERT INTO "countrylanguage" VALUES ("USA", "Spanish", "13.5");
INSERT INTO "countrylanguage" VALUES ("USA", "Chinese", "1.0");
INSERT INTO "countrylanguage" VALUES ("CAN", "English", "56.0");
INSERT INTO "countrylanguage" VALUES ("CAN", "French", "21.0");
INSERT INTO "countrylanguage" VALUES ("CAN", "Punjabi", "2.0");
INSERT INTO "countrylanguage" VALUES ("MEX", "Spanish", "92.7");
INSERT INTO "countrylanguage" VALUES ("MEX", "Nahuatl", "1.5");
INSERT INTO "countrylanguage" VALUES ("FRA", "French", "88.0");
INSERT INTO "countrylanguage" VALUES ("FRA", "Arabic", "5.0");
INSERT INTO "countrylanguage" VALUES ("DEU", "German", "95.0");
INSERT INTO "countrylanguage" VALUES ("DEU", "Turkish", "2.0");
INSERT INTO "countrylanguage" VALUES ("JPN", "Japanese", "99.0");
INSERT INTO "countrylanguage" VALUES ("CHN", "Mandarin", "70.0");
INSERT INTO "countrylanguage" VALUES ("CHN", "Cantonese", "5.0");
INSERT INTO "countrylanguage" VALUES ("CHN", "Shanghainese", "3.0");
INSERT INTO "countrylanguage" VALUES ("IND", "Hindi", "41.0");
INSERT INTO "countrylanguage" VALUES ("IND", "Bengali", "8.0");
INSERT INTO "countrylanguage" VALUES ("IND", "Telugu", "7.0");
INSERT INTO "countrylanguage" VALUES ("BRA", "Portuguese", "98.0");
INSERT INTO "countrylanguage" VALUES ("BRA", "Spanish", "1.0");
INSERT INTO "countrylanguage" VALUES ("ARG", "Spanish", "97.0");
INSERT INTO "countrylanguage" VALUES ("ARG", "Italian", "1.5");