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 "car_makers" (
"Id" INT,
"Country" TEXT,
PRIMARY KEY ("Id"),
FOREIGN KEY ("Country") REFERENCES "countries"("CountryId")
);

CREATE TABLE "continents" (
"ContId" INT UNIQUE,
"Continent" TEXT,
PRIMARY KEY ("ContId")
);

CREATE TABLE "countries" (
"CountryId" INT UNIQUE,
"CountryName" TEXT,
"Continent" INT,
PRIMARY KEY ("CountryId"),
FOREIGN KEY ("Continent") REFERENCES "continents"("ContId")
);

CREATE TABLE "model_list" (
"ModelId" INT,
"Maker" INT,
PRIMARY KEY ("ModelId"),
FOREIGN KEY ("Maker") REFERENCES "car_makers"("Id")
);





INSERT INTO "continents" VALUES ("1", "Asia");
INSERT INTO "continents" VALUES ("2", "Europe");
INSERT INTO "continents" VALUES ("3", "North America");
INSERT INTO "continents" VALUES ("4", "South America");
INSERT INTO "continents" VALUES ("5", "Africa");
INSERT INTO "continents" VALUES ("6", "Oceania");
INSERT INTO "countries" VALUES ("1", "Japan", "1");
INSERT INTO "countries" VALUES ("2", "Germany", "2");
INSERT INTO "countries" VALUES ("3", "USA", "3");
INSERT INTO "countries" VALUES ("4", "France", "2");
INSERT INTO "countries" VALUES ("5", "Italy", "2");
INSERT INTO "countries" VALUES ("6", "China", "1");
INSERT INTO "countries" VALUES ("7", "Brazil", "4");
INSERT INTO "countries" VALUES ("8", "Australia", "6");
INSERT INTO "countries" VALUES ("9", "India", "1");
INSERT INTO "countries" VALUES ("10", "Canada", "3");
INSERT INTO "countries" VALUES ("11", "Mexico", "3");
INSERT INTO "countries" VALUES ("12", "South Africa", "5");
INSERT INTO "countries" VALUES ("13", "Argentina", "4");
INSERT INTO "countries" VALUES ("14", "UK", "2");
INSERT INTO "countries" VALUES ("15", "South Korea", "1");
INSERT INTO "car_makers" VALUES ("1", "Japan");
INSERT INTO "car_makers" VALUES ("2", "Germany");
INSERT INTO "car_makers" VALUES ("3", "USA");
INSERT INTO "car_makers" VALUES ("4", "France");
INSERT INTO "car_makers" VALUES ("5", "Italy");
INSERT INTO "car_makers" VALUES ("6", "China");
INSERT INTO "car_makers" VALUES ("7", "Brazil");
INSERT INTO "car_makers" VALUES ("8", "Australia");
INSERT INTO "car_makers" VALUES ("9", "India");
INSERT INTO "car_makers" VALUES ("10", "Canada");
INSERT INTO "car_makers" VALUES ("11", "Mexico");
INSERT INTO "car_makers" VALUES ("12", "South Africa");
INSERT INTO "car_makers" VALUES ("13", "Argentina");
INSERT INTO "car_makers" VALUES ("14", "UK");
INSERT INTO "car_makers" VALUES ("15", "South Korea");
INSERT INTO "model_list" VALUES ("1", "1");
INSERT INTO "model_list" VALUES ("2", "1");
INSERT INTO "model_list" VALUES ("3", "2");
INSERT INTO "model_list" VALUES ("4", "3");
INSERT INTO "model_list" VALUES ("5", "4");
INSERT INTO "model_list" VALUES ("6", "5");
INSERT INTO "model_list" VALUES ("7", "6");
INSERT INTO "model_list" VALUES ("8", "7");
INSERT INTO "model_list" VALUES ("9", "8");
INSERT INTO "model_list" VALUES ("10", "9");
INSERT INTO "model_list" VALUES ("11", "10");
INSERT INTO "model_list" VALUES ("12", "11");
INSERT INTO "model_list" VALUES ("13", "12");
INSERT INTO "model_list" VALUES ("14", "13");
INSERT INTO "model_list" VALUES ("15", "14");
INSERT INTO "model_list" VALUES ("16", "15");
INSERT INTO "model_list" VALUES ("17", "1");
INSERT INTO "model_list" VALUES ("18", "2");
INSERT INTO "model_list" VALUES ("19", "3");
INSERT INTO "model_list" VALUES ("20", "4");