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

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

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





INSERT INTO "countries" VALUES ("1", "France", "1");
INSERT INTO "countries" VALUES ("2", "Germany", "1");
INSERT INTO "countries" VALUES ("3", "Japan", "2");
INSERT INTO "countries" VALUES ("4", "United States", "3");
INSERT INTO "countries" VALUES ("5", "Italy", "1");
INSERT INTO "countries" VALUES ("6", "South Korea", "2");
INSERT INTO "car_makers" VALUES ("101", "Peugeot", "Peugeot S.A.", "1");
INSERT INTO "car_makers" VALUES ("102", "Renault", "Renault Group", "1");
INSERT INTO "car_makers" VALUES ("103", "Citroen", "Citroen Automobiles", "1");
INSERT INTO "car_makers" VALUES ("104", "BMW", "Bayerische Motoren Werke AG", "2");
INSERT INTO "car_makers" VALUES ("105", "Toyota", "Toyota Motor Corporation", "3");
INSERT INTO "car_makers" VALUES ("106", "Ford", "Ford Motor Company", "4");
INSERT INTO "car_makers" VALUES ("107", "Ferrari", "Ferrari S.p.A.", "5");
INSERT INTO "car_makers" VALUES ("108", "Hyundai", "Hyundai Motor Company", "6");
INSERT INTO "car_makers" VALUES ("109", "Bugatti", "Bugatti Automobiles S.A.S.", "1");
INSERT INTO "car_makers" VALUES ("110", "Dacia", "Dacia S.A.", "1");
INSERT INTO "model_list" VALUES ("1001", "101");
INSERT INTO "model_list" VALUES ("1002", "101");
INSERT INTO "model_list" VALUES ("1003", "102");
INSERT INTO "model_list" VALUES ("1004", "103");
INSERT INTO "model_list" VALUES ("1005", "104");
INSERT INTO "model_list" VALUES ("1006", "105");
INSERT INTO "model_list" VALUES ("1007", "106");
INSERT INTO "model_list" VALUES ("1008", "107");
INSERT INTO "model_list" VALUES ("1009", "108");
INSERT INTO "model_list" VALUES ("1010", "109");
INSERT INTO "model_list" VALUES ("1011", "110");
INSERT INTO "model_list" VALUES ("1012", "110");