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,
"Maker" TEXT,
PRIMARY KEY ("Id")
);

CREATE TABLE "car_names" (
"MakeId" INT UNIQUE,
"Model" 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 "car_makers" VALUES ("1", "Ford");
INSERT INTO "car_makers" VALUES ("2", "Chevrolet");
INSERT INTO "car_makers" VALUES ("3", "Honda");
INSERT INTO "car_makers" VALUES ("4", "Toyota");
INSERT INTO "car_makers" VALUES ("5", "BMW");
INSERT INTO "car_makers" VALUES ("6", "Mercedes-Benz");
INSERT INTO "car_makers" VALUES ("7", "Volkswagen");
INSERT INTO "car_makers" VALUES ("8", "Nissan");
INSERT INTO "car_makers" VALUES ("9", "Audi");
INSERT INTO "car_makers" VALUES ("10", "Hyundai");
INSERT INTO "model_list" VALUES ("1", "F-150");
INSERT INTO "model_list" VALUES ("2", "Silverado");
INSERT INTO "model_list" VALUES ("3", "Civic");
INSERT INTO "model_list" VALUES ("4", "Corolla");
INSERT INTO "model_list" VALUES ("5", "3 Series");
INSERT INTO "model_list" VALUES ("6", "C-Class");
INSERT INTO "model_list" VALUES ("7", "Golf");
INSERT INTO "model_list" VALUES ("8", "Altima");
INSERT INTO "model_list" VALUES ("9", "A4");
INSERT INTO "model_list" VALUES ("10", "Elantra");
INSERT INTO "model_list" VALUES ("11", "Mustang");
INSERT INTO "model_list" VALUES ("12", "Camaro");
INSERT INTO "model_list" VALUES ("13", "Accord");
INSERT INTO "model_list" VALUES ("14", "Camry");
INSERT INTO "model_list" VALUES ("15", "5 Series");
INSERT INTO "model_list" VALUES ("16", "E-Class");
INSERT INTO "model_list" VALUES ("17", "Passat");
INSERT INTO "model_list" VALUES ("18", "Titan");
INSERT INTO "model_list" VALUES ("19", "Q5");
INSERT INTO "model_list" VALUES ("20", "Sonata");
INSERT INTO "model_list" VALUES ("21", "Pinto");
INSERT INTO "model_list" VALUES ("22", "Malibu");
INSERT INTO "model_list" VALUES ("23", "Prelude");
INSERT INTO "model_list" VALUES ("24", "Celica");
INSERT INTO "model_list" VALUES ("25", "2002");
INSERT INTO "model_list" VALUES ("26", "W123");
INSERT INTO "model_list" VALUES ("27", "Rabbit");
INSERT INTO "model_list" VALUES ("28", "Datsun 280ZX");
INSERT INTO "model_list" VALUES ("29", "Fox");
INSERT INTO "model_list" VALUES ("30", "Pony");
INSERT INTO "car_names" VALUES ("1", "F-150");
INSERT INTO "car_names" VALUES ("2", "Silverado");
INSERT INTO "car_names" VALUES ("3", "Civic");
INSERT INTO "car_names" VALUES ("4", "Corolla");
INSERT INTO "car_names" VALUES ("5", "3 Series");
INSERT INTO "car_names" VALUES ("6", "C-Class");
INSERT INTO "car_names" VALUES ("7", "Golf");
INSERT INTO "car_names" VALUES ("8", "Altima");
INSERT INTO "car_names" VALUES ("9", "A4");
INSERT INTO "car_names" VALUES ("10", "Elantra");
INSERT INTO "car_names" VALUES ("11", "Mustang");
INSERT INTO "car_names" VALUES ("12", "Camaro");
INSERT INTO "car_names" VALUES ("13", "Accord");
INSERT INTO "car_names" VALUES ("14", "Camry");
INSERT INTO "car_names" VALUES ("15", "5 Series");
INSERT INTO "car_names" VALUES ("16", "E-Class");
INSERT INTO "car_names" VALUES ("17", "Passat");
INSERT INTO "car_names" VALUES ("18", "Titan");
INSERT INTO "car_names" VALUES ("19", "Q5");
INSERT INTO "car_names" VALUES ("20", "Sonata");
INSERT INTO "car_names" VALUES ("21", "Pinto");
INSERT INTO "car_names" VALUES ("22", "Malibu");
INSERT INTO "car_names" VALUES ("23", "Prelude");
INSERT INTO "car_names" VALUES ("24", "Celica");
INSERT INTO "car_names" VALUES ("25", "2002");
INSERT INTO "car_names" VALUES ("26", "W123");
INSERT INTO "car_names" VALUES ("27", "Rabbit");
INSERT INTO "car_names" VALUES ("28", "Datsun 280ZX");
INSERT INTO "car_names" VALUES ("29", "Fox");
INSERT INTO "car_names" VALUES ("30", "Pony");
INSERT INTO "cars_data" VALUES ("1", "2020");
INSERT INTO "cars_data" VALUES ("2", "2021");
INSERT INTO "cars_data" VALUES ("3", "2022");
INSERT INTO "cars_data" VALUES ("4", "2020");
INSERT INTO "cars_data" VALUES ("5", "2021");
INSERT INTO "cars_data" VALUES ("6", "2022");
INSERT INTO "cars_data" VALUES ("7", "2020");
INSERT INTO "cars_data" VALUES ("8", "2021");
INSERT INTO "cars_data" VALUES ("9", "2022");
INSERT INTO "cars_data" VALUES ("10", "2020");
INSERT INTO "cars_data" VALUES ("11", "1980");
INSERT INTO "cars_data" VALUES ("12", "1980");
INSERT INTO "cars_data" VALUES ("13", "1980");
INSERT INTO "cars_data" VALUES ("14", "1980");
INSERT INTO "cars_data" VALUES ("15", "1981");
INSERT INTO "cars_data" VALUES ("16", "1981");
INSERT INTO "cars_data" VALUES ("17", "1982");
INSERT INTO "cars_data" VALUES ("18", "1982");
INSERT INTO "cars_data" VALUES ("19", "1983");
INSERT INTO "cars_data" VALUES ("20", "1983");
INSERT INTO "cars_data" VALUES ("21", "1980");
INSERT INTO "cars_data" VALUES ("22", "1980");
INSERT INTO "cars_data" VALUES ("23", "1980");
INSERT INTO "cars_data" VALUES ("24", "1980");
INSERT INTO "cars_data" VALUES ("25", "1979");
INSERT INTO "cars_data" VALUES ("26", "1979");
INSERT INTO "cars_data" VALUES ("27", "1980");
INSERT INTO "cars_data" VALUES ("28", "1980");
INSERT INTO "cars_data" VALUES ("29", "1980");
INSERT INTO "cars_data" VALUES ("30", "1980");