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),
"Population" INT,
"LifeExpectancy" FLOAT,
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", "15000000");
INSERT INTO "city" VALUES ("6", "4500000");
INSERT INTO "city" VALUES ("7", "700000");
INSERT INTO "city" VALUES ("8", "2000000");
INSERT INTO "country" VALUES ("USA", "United States", "331000000", "78.9");
INSERT INTO "country" VALUES ("IND", "India", "1380004385", "69.7");
INSERT INTO "country" VALUES ("CAN", "Canada", "37700000", "82.3");
INSERT INTO "country" VALUES ("BEL", "Belgium", "11500000", "81.5");
INSERT INTO "country" VALUES ("CHE", "Switzerland", "8600000", "83.8");
INSERT INTO "country" VALUES ("ZAF", "South Africa", "59300000", "64.1");
INSERT INTO "country" VALUES ("SGP", "Singapore", "5700000", "83.6");
INSERT INTO "country" VALUES ("MYS", "Malaysia", "32000000", "76.3");
INSERT INTO "countrylanguage" VALUES ("USA", "English", "T", "82.1");
INSERT INTO "countrylanguage" VALUES ("USA", "Spanish", "F", "13.5");
INSERT INTO "countrylanguage" VALUES ("USA", "Chinese", "F", "1.1");
INSERT INTO "countrylanguage" VALUES ("IND", "Hindi", "T", "41.0");
INSERT INTO "countrylanguage" VALUES ("IND", "English", "F", "12.2");
INSERT INTO "countrylanguage" VALUES ("IND", "Bengali", "F", "8.1");
INSERT INTO "countrylanguage" VALUES ("IND", "Telugu", "F", "7.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 ("BEL", "Dutch", "T", "60.0");
INSERT INTO "countrylanguage" VALUES ("BEL", "French", "T", "40.0");
INSERT INTO "countrylanguage" VALUES ("BEL", "German", "F", "1.0");
INSERT INTO "countrylanguage" VALUES ("CHE", "German", "T", "62.0");
INSERT INTO "countrylanguage" VALUES ("CHE", "French", "T", "23.0");
INSERT INTO "countrylanguage" VALUES ("CHE", "Italian", "T", "8.0");
INSERT INTO "countrylanguage" VALUES ("ZAF", "Zulu", "F", "22.7");
INSERT INTO "countrylanguage" VALUES ("ZAF", "Xhosa", "F", "16.0");
INSERT INTO "countrylanguage" VALUES ("ZAF", "Afrikaans", "T", "13.5");
INSERT INTO "countrylanguage" VALUES ("ZAF", "English", "F", "9.6");
INSERT INTO "countrylanguage" VALUES ("SGP", "English", "T", "36.9");
INSERT INTO "countrylanguage" VALUES ("SGP", "Mandarin", "T", "35.6");
INSERT INTO "countrylanguage" VALUES ("SGP", "Malay", "T", "13.3");
INSERT INTO "countrylanguage" VALUES ("SGP", "Tamil", "F", "3.3");
INSERT INTO "countrylanguage" VALUES ("MYS", "Malay", "T", "60.0");
INSERT INTO "countrylanguage" VALUES ("MYS", "English", "F", "20.0");
INSERT INTO "countrylanguage" VALUES ("MYS", "Chinese", "F", "10.0");
INSERT INTO "countrylanguage" VALUES ("MYS", "Tamil", "F", "5.0");