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

CREATE TABLE "car_names" (
"MakeId" INT,
"Model" TEXT,
"Make" TEXT,
PRIMARY KEY ("MakeId"),
FOREIGN KEY ("Model") REFERENCES "model_list"("Model")
);

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

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





INSERT INTO "countries" VALUES ("1", "Japan");
INSERT INTO "countries" VALUES ("2", "USA");
INSERT INTO "countries" VALUES ("3", "Germany");
INSERT INTO "countries" VALUES ("4", "South Korea");
INSERT INTO "countries" VALUES ("5", "France");
INSERT INTO "countries" VALUES ("6", "Italy");
INSERT INTO "car_makers" VALUES ("1", "Toyota", "1");
INSERT INTO "car_makers" VALUES ("2", "Honda", "1");
INSERT INTO "car_makers" VALUES ("3", "Ford", "2");
INSERT INTO "car_makers" VALUES ("4", "Chevrolet", "2");
INSERT INTO "car_makers" VALUES ("5", "BMW", "3");
INSERT INTO "car_makers" VALUES ("6", "Audi", "3");
INSERT INTO "car_makers" VALUES ("7", "Hyundai", "4");
INSERT INTO "car_makers" VALUES ("8", "Kia", "4");
INSERT INTO "car_makers" VALUES ("9", "Peugeot", "5");
INSERT INTO "car_makers" VALUES ("10", "Renault", "5");
INSERT INTO "car_makers" VALUES ("11", "Fiat", "6");
INSERT INTO "car_makers" VALUES ("12", "Lancia", "6");
INSERT INTO "car_makers" VALUES ("13", "Tesla", "2");
INSERT INTO "car_makers" VALUES ("14", "Nissan", "1");
INSERT INTO "car_makers" VALUES ("15", "Volkswagen", "3");
INSERT INTO "model_list" VALUES ("1", "1", "Camry");
INSERT INTO "model_list" VALUES ("2", "2", "Accord");
INSERT INTO "model_list" VALUES ("3", "3", "Mustang");
INSERT INTO "model_list" VALUES ("4", "4", "Impala");
INSERT INTO "model_list" VALUES ("5", "5", "3 Series");
INSERT INTO "model_list" VALUES ("6", "6", "A4");
INSERT INTO "model_list" VALUES ("7", "7", "Elantra");
INSERT INTO "model_list" VALUES ("8", "8", "Sorento");
INSERT INTO "model_list" VALUES ("9", "9", "308");
INSERT INTO "model_list" VALUES ("10", "10", "Clio");
INSERT INTO "model_list" VALUES ("11", "11", "500");
INSERT INTO "model_list" VALUES ("12", "12", "Delta");
INSERT INTO "model_list" VALUES ("13", "13", "Model S");
INSERT INTO "model_list" VALUES ("14", "14", "Altima");
INSERT INTO "model_list" VALUES ("15", "15", "Golf");
INSERT INTO "model_list" VALUES ("16", "1", "Corolla");
INSERT INTO "model_list" VALUES ("17", "2", "Civic");
INSERT INTO "model_list" VALUES ("18", "3", "F-150");
INSERT INTO "model_list" VALUES ("19", "4", "Malibu");
INSERT INTO "model_list" VALUES ("20", "5", "X5");
INSERT INTO "model_list" VALUES ("21", "6", "Q5");
INSERT INTO "model_list" VALUES ("22", "7", "Tucson");
INSERT INTO "model_list" VALUES ("23", "8", "Soul");
INSERT INTO "model_list" VALUES ("24", "9", "208");
INSERT INTO "model_list" VALUES ("25", "10", "Megane");
INSERT INTO "model_list" VALUES ("26", "11", "Panda");
INSERT INTO "model_list" VALUES ("27", "12", "Ypsilon");
INSERT INTO "model_list" VALUES ("28", "13", "Model 3");
INSERT INTO "model_list" VALUES ("29", "14", "Sentra");
INSERT INTO "model_list" VALUES ("30", "15", "Passat");
INSERT INTO "car_names" VALUES ("1", "Camry", "Toyota");
INSERT INTO "car_names" VALUES ("2", "Camry", "Honda");
INSERT INTO "car_names" VALUES ("3", "Camry", "Ford");
INSERT INTO "car_names" VALUES ("4", "Camry", "Chevrolet");
INSERT INTO "car_names" VALUES ("5", "Camry", "BMW");
INSERT INTO "car_names" VALUES ("6", "Camry", "Audi");
INSERT INTO "car_names" VALUES ("7", "Camry", "Hyundai");
INSERT INTO "car_names" VALUES ("8", "Camry", "Kia");
INSERT INTO "car_names" VALUES ("9", "Camry", "Peugeot");
INSERT INTO "car_names" VALUES ("10", "Camry", "Renault");
INSERT INTO "car_names" VALUES ("11", "Camry", "Fiat");
INSERT INTO "car_names" VALUES ("12", "Camry", "Lancia");
INSERT INTO "car_names" VALUES ("13", "Accord", "Honda");
INSERT INTO "car_names" VALUES ("14", "Accord", "Toyota");
INSERT INTO "car_names" VALUES ("15", "Accord", "Nissan");
INSERT INTO "car_names" VALUES ("16", "Mustang", "Ford");
INSERT INTO "car_names" VALUES ("17", "Mustang", "Chevrolet");
INSERT INTO "car_names" VALUES ("18", "Mustang", "BMW");
INSERT INTO "car_names" VALUES ("19", "Impala", "Chevrolet");
INSERT INTO "car_names" VALUES ("20", "Impala", "Ford");
INSERT INTO "car_names" VALUES ("21", "3 Series", "BMW");
INSERT INTO "car_names" VALUES ("22", "3 Series", "Audi");
INSERT INTO "car_names" VALUES ("23", "3 Series", "Volkswagen");
INSERT INTO "car_names" VALUES ("24", "A4", "Audi");
INSERT INTO "car_names" VALUES ("25", "A4", "BMW");
INSERT INTO "car_names" VALUES ("26", "Elantra", "Hyundai");
INSERT INTO "car_names" VALUES ("27", "Elantra", "Kia");
INSERT INTO "car_names" VALUES ("28", "Sorento", "Kia");
INSERT INTO "car_names" VALUES ("29", "Sorento", "Hyundai");
INSERT INTO "car_names" VALUES ("30", "308", "Peugeot");
INSERT INTO "car_names" VALUES ("31", "308", "Renault");
INSERT INTO "car_names" VALUES ("32", "Clio", "Renault");
INSERT INTO "car_names" VALUES ("33", "Clio", "Peugeot");
INSERT INTO "car_names" VALUES ("34", "500", "Fiat");
INSERT INTO "car_names" VALUES ("35", "500", "Lancia");
INSERT INTO "car_names" VALUES ("36", "Delta", "Lancia");
INSERT INTO "car_names" VALUES ("37", "Delta", "Fiat");
INSERT INTO "car_names" VALUES ("38", "Model S", "Tesla");
INSERT INTO "car_names" VALUES ("39", "Model S", "Ford");
INSERT INTO "car_names" VALUES ("40", "Altima", "Nissan");
INSERT INTO "car_names" VALUES ("41", "Altima", "Toyota");
INSERT INTO "car_names" VALUES ("42", "Golf", "Volkswagen");
INSERT INTO "car_names" VALUES ("43", "Golf", "Audi");
INSERT INTO "car_names" VALUES ("44", "Corolla", "Toyota");
INSERT INTO "car_names" VALUES ("45", "Corolla", "Honda");
INSERT INTO "car_names" VALUES ("46", "Civic", "Honda");
INSERT INTO "car_names" VALUES ("47", "Civic", "Toyota");
INSERT INTO "car_names" VALUES ("48", "F-150", "Ford");
INSERT INTO "car_names" VALUES ("49", "F-150", "Chevrolet");
INSERT INTO "car_names" VALUES ("50", "Malibu", "Chevrolet");
INSERT INTO "car_names" VALUES ("51", "Malibu", "Ford");
INSERT INTO "car_names" VALUES ("52", "X5", "BMW");
INSERT INTO "car_names" VALUES ("53", "X5", "Audi");
INSERT INTO "car_names" VALUES ("54", "Q5", "Audi");
INSERT INTO "car_names" VALUES ("55", "Q5", "BMW");
INSERT INTO "car_names" VALUES ("56", "Tucson", "Hyundai");
INSERT INTO "car_names" VALUES ("57", "Tucson", "Kia");
INSERT INTO "car_names" VALUES ("58", "Soul", "Kia");
INSERT INTO "car_names" VALUES ("59", "Soul", "Hyundai");
INSERT INTO "car_names" VALUES ("60", "208", "Peugeot");
INSERT INTO "car_names" VALUES ("61", "208", "Renault");
INSERT INTO "car_names" VALUES ("62", "Megane", "Renault");
INSERT INTO "car_names" VALUES ("63", "Megane", "Peugeot");
INSERT INTO "car_names" VALUES ("64", "Panda", "Fiat");
INSERT INTO "car_names" VALUES ("65", "Panda", "Lancia");
INSERT INTO "car_names" VALUES ("66", "Ypsilon", "Lancia");
INSERT INTO "car_names" VALUES ("67", "Ypsilon", "Fiat");
INSERT INTO "car_names" VALUES ("68", "Model 3", "Tesla");
INSERT INTO "car_names" VALUES ("69", "Model 3", "Ford");
INSERT INTO "car_names" VALUES ("70", "Sentra", "Nissan");
INSERT INTO "car_names" VALUES ("71", "Sentra", "Toyota");
INSERT INTO "car_names" VALUES ("72", "Passat", "Volkswagen");
INSERT INTO "car_names" VALUES ("73", "Passat", "Audi");