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

CREATE TABLE "country" (
"Code" CHAR(3) UNIQUE,
"Name" CHAR(52),
"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", "Madrid");
INSERT INTO "city" VALUES ("2", "Barcelona");
INSERT INTO "city" VALUES ("3", "Buenos Aires");
INSERT INTO "city" VALUES ("4", "Mexico City");
INSERT INTO "city" VALUES ("5", "Lima");
INSERT INTO "city" VALUES ("6", "Bogota");
INSERT INTO "city" VALUES ("7", "Quito");
INSERT INTO "city" VALUES ("8", "San Juan");
INSERT INTO "city" VALUES ("9", "Havana");
INSERT INTO "city" VALUES ("10", "Guatemala City");
INSERT INTO "country" VALUES ("ESP", "Spain", "Europe");
INSERT INTO "country" VALUES ("ARG", "Argentina", "South America");
INSERT INTO "country" VALUES ("MEX", "Mexico", "North America");
INSERT INTO "country" VALUES ("PER", "Peru", "South America");
INSERT INTO "country" VALUES ("COL", "Colombia", "South America");
INSERT INTO "country" VALUES ("ECU", "Ecuador", "South America");
INSERT INTO "country" VALUES ("PRI", "Puerto Rico", "Caribbean");
INSERT INTO "country" VALUES ("CUB", "Cuba", "Caribbean");
INSERT INTO "country" VALUES ("GTM", "Guatemala", "Central America");
INSERT INTO "country" VALUES ("USA", "United States", "North America");
INSERT INTO "country" VALUES ("BRA", "Brazil", "South America");
INSERT INTO "country" VALUES ("FRA", "France", "Europe");
INSERT INTO "countrylanguage" VALUES ("ESP", "Spanish", "T", "74.0");
INSERT INTO "countrylanguage" VALUES ("ESP", "Catalan", "F", "17.0");
INSERT INTO "countrylanguage" VALUES ("ESP", "Galician", "F", "7.0");
INSERT INTO "countrylanguage" VALUES ("ARG", "Spanish", "T", "98.0");
INSERT INTO "countrylanguage" VALUES ("ARG", "Italian", "F", "1.5");
INSERT INTO "countrylanguage" VALUES ("MEX", "Spanish", "T", "92.7");
INSERT INTO "countrylanguage" VALUES ("MEX", "Nahuatl", "F", "1.5");
INSERT INTO "countrylanguage" VALUES ("PER", "Spanish", "T", "84.1");
INSERT INTO "countrylanguage" VALUES ("PER", "Quechua", "F", "13.0");
INSERT INTO "countrylanguage" VALUES ("COL", "Spanish", "T", "99.2");
INSERT INTO "countrylanguage" VALUES ("ECU", "Spanish", "T", "93.0");
INSERT INTO "countrylanguage" VALUES ("PRI", "Spanish", "T", "95.0");
INSERT INTO "countrylanguage" VALUES ("CUB", "Spanish", "T", "99.8");
INSERT INTO "countrylanguage" VALUES ("GTM", "Spanish", "T", "60.0");
INSERT INTO "countrylanguage" VALUES ("GTM", "K'iche'", "F", "20.0");
INSERT INTO "countrylanguage" VALUES ("USA", "English", "T", "80.0");
INSERT INTO "countrylanguage" VALUES ("USA", "Spanish", "F", "12.0");
INSERT INTO "countrylanguage" VALUES ("BRA", "Portuguese", "T", "98.0");
INSERT INTO "countrylanguage" VALUES ("FRA", "French", "T", "88.0");
INSERT INTO "countrylanguage" VALUES ("FRA", "Spanish", "F", "1.0");