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

CREATE TABLE "country" (
"Code" CHAR(3) UNIQUE,
"Region" CHAR(26),
"Population" INT,
PRIMARY KEY ("Code")
);

CREATE TABLE "countrylanguage" (
"CountryCode" CHAR(3),
"Language" CHAR(30),
PRIMARY KEY ("CountryCode", "Language")
);





INSERT INTO "country" VALUES ("AFG", "Southern and Central Asia", "38928341");
INSERT INTO "country" VALUES ("USA", "North America", "331002651");
INSERT INTO "country" VALUES ("IND", "Southern and Central Asia", "1380004385");
INSERT INTO "country" VALUES ("PAK", "Southern and Central Asia", "220892340");
INSERT INTO "country" VALUES ("CHN", "Eastern Asia", "1439323776");
INSERT INTO "city" VALUES ("1", "Kabul", "AFG", "Kabol");
INSERT INTO "city" VALUES ("2", "New York", "USA", "New York");
INSERT INTO "city" VALUES ("3", "Mumbai", "IND", "Maharashtra");
INSERT INTO "city" VALUES ("4", "Karachi", "PAK", "Sindh");
INSERT INTO "city" VALUES ("5", "Beijing", "CHN", "Beijing");
INSERT INTO "countrylanguage" VALUES ("AFG", "Pashto");
INSERT INTO "countrylanguage" VALUES ("AFG", "Dari");
INSERT INTO "countrylanguage" VALUES ("USA", "English");
INSERT INTO "countrylanguage" VALUES ("IND", "Hindi");
INSERT INTO "countrylanguage" VALUES ("PAK", "Urdu");
INSERT INTO "countrylanguage" VALUES ("CHN", "Mandarin");