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_names" (
"MakeId" INT,
"Model" TEXT,
"Make" TEXT,
PRIMARY KEY ("MakeId"),
FOREIGN KEY ("Model") REFERENCES "model_list"("Model")
);

CREATE TABLE "cars_data" (
"Id" INT,
"Year" INT,
PRIMARY KEY ("Id"),
FOREIGN KEY ("Id") REFERENCES "car_names"("MakeId")
);

CREATE TABLE "model_list" (
"ModelId" INT,
"Model" TEXT UNIQUE,
PRIMARY KEY ("ModelId")
);





INSERT INTO "model_list" VALUES ("1", "Civic");
INSERT INTO "model_list" VALUES ("2", "Accord");
INSERT INTO "model_list" VALUES ("3", "Corolla");
INSERT INTO "model_list" VALUES ("4", "Camry");
INSERT INTO "model_list" VALUES ("5", "Mustang");
INSERT INTO "model_list" VALUES ("6", "F-150");
INSERT INTO "model_list" VALUES ("7", "Golf");
INSERT INTO "model_list" VALUES ("8", "Jetta");
INSERT INTO "model_list" VALUES ("9", "911");
INSERT INTO "model_list" VALUES ("10", "Cayenne");
INSERT INTO "model_list" VALUES ("11", "Charger");
INSERT INTO "model_list" VALUES ("12", "Ram 1500");
INSERT INTO "model_list" VALUES ("13", "Silverado");
INSERT INTO "model_list" VALUES ("14", "Malibu");
INSERT INTO "model_list" VALUES ("15", "Wrangler");
INSERT INTO "model_list" VALUES ("16", "Cherokee");
INSERT INTO "car_names" VALUES ("1", "Civic", "Honda");
INSERT INTO "car_names" VALUES ("2", "Accord", "Honda");
INSERT INTO "car_names" VALUES ("3", "Corolla", "Toyota");
INSERT INTO "car_names" VALUES ("4", "Camry", "Toyota");
INSERT INTO "car_names" VALUES ("5", "Mustang", "Ford");
INSERT INTO "car_names" VALUES ("6", "F-150", "Ford");
INSERT INTO "car_names" VALUES ("7", "Golf", "Volkswagen");
INSERT INTO "car_names" VALUES ("8", "Jetta", "Volkswagen");
INSERT INTO "car_names" VALUES ("9", "911", "Porsche");
INSERT INTO "car_names" VALUES ("10", "Cayenne", "Porsche");
INSERT INTO "car_names" VALUES ("11", "Charger", "Dodge");
INSERT INTO "car_names" VALUES ("12", "Ram 1500", "Dodge");
INSERT INTO "car_names" VALUES ("13", "Silverado", "Chevrolet");
INSERT INTO "car_names" VALUES ("14", "Malibu", "Chevrolet");
INSERT INTO "car_names" VALUES ("15", "Wrangler", "Jeep");
INSERT INTO "car_names" VALUES ("16", "Cherokee", "Jeep");
INSERT INTO "car_names" VALUES ("17", "Civic", "Honda");
INSERT INTO "car_names" VALUES ("18", "Mustang", "Ford");
INSERT INTO "car_names" VALUES ("19", "Corolla", "Toyota");
INSERT INTO "car_names" VALUES ("20", "Golf", "Volkswagen");
INSERT INTO "cars_data" VALUES ("1", "1980");
INSERT INTO "cars_data" VALUES ("2", "1985");
INSERT INTO "cars_data" VALUES ("3", "1980");
INSERT INTO "cars_data" VALUES ("4", "1990");
INSERT INTO "cars_data" VALUES ("5", "1980");
INSERT INTO "cars_data" VALUES ("6", "1995");
INSERT INTO "cars_data" VALUES ("7", "1980");
INSERT INTO "cars_data" VALUES ("8", "2000");
INSERT INTO "cars_data" VALUES ("9", "1980");
INSERT INTO "cars_data" VALUES ("10", "2005");
INSERT INTO "cars_data" VALUES ("11", "1980");
INSERT INTO "cars_data" VALUES ("12", "2010");
INSERT INTO "cars_data" VALUES ("13", "1980");
INSERT INTO "cars_data" VALUES ("14", "2015");
INSERT INTO "cars_data" VALUES ("15", "1980");
INSERT INTO "cars_data" VALUES ("16", "2020");
INSERT INTO "cars_data" VALUES ("17", "1980");
INSERT INTO "cars_data" VALUES ("18", "1980");
INSERT INTO "cars_data" VALUES ("19", "1980");
INSERT INTO "cars_data" VALUES ("20", "1980");