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

CREATE TABLE "cars_data" (
"Id" INT,
"MPG" TEXT,
"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", "Nissan");
INSERT INTO "car_makers" VALUES ("8", "Volkswagen");
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", "Altima");
INSERT INTO "model_list" VALUES ("8", "Golf");
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", "X5");
INSERT INTO "model_list" VALUES ("16", "E-Class");
INSERT INTO "model_list" VALUES ("17", "Titan");
INSERT INTO "model_list" VALUES ("18", "Jetta");
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", "Nova");
INSERT INTO "model_list" VALUES ("23", "Accord CVCC");
INSERT INTO "model_list" VALUES ("24", "Celica");
INSERT INTO "car_names" VALUES ("1", "F-150", "Ford");
INSERT INTO "car_names" VALUES ("2", "Silverado", "Chevrolet");
INSERT INTO "car_names" VALUES ("3", "Civic", "Honda");
INSERT INTO "car_names" VALUES ("4", "Corolla", "Toyota");
INSERT INTO "car_names" VALUES ("5", "3 Series", "BMW");
INSERT INTO "car_names" VALUES ("6", "C-Class", "Mercedes-Benz");
INSERT INTO "car_names" VALUES ("7", "Altima", "Nissan");
INSERT INTO "car_names" VALUES ("8", "Golf", "Volkswagen");
INSERT INTO "car_names" VALUES ("9", "A4", "Audi");
INSERT INTO "car_names" VALUES ("10", "Elantra", "Hyundai");
INSERT INTO "car_names" VALUES ("11", "Mustang", "Ford");
INSERT INTO "car_names" VALUES ("12", "Camaro", "Chevrolet");
INSERT INTO "car_names" VALUES ("13", "Accord", "Honda");
INSERT INTO "car_names" VALUES ("14", "Camry", "Toyota");
INSERT INTO "car_names" VALUES ("15", "X5", "BMW");
INSERT INTO "car_names" VALUES ("16", "E-Class", "Mercedes-Benz");
INSERT INTO "car_names" VALUES ("17", "Titan", "Nissan");
INSERT INTO "car_names" VALUES ("18", "Jetta", "Volkswagen");
INSERT INTO "car_names" VALUES ("19", "Q5", "Audi");
INSERT INTO "car_names" VALUES ("20", "Sonata", "Hyundai");
INSERT INTO "car_names" VALUES ("21", "Pinto", "Ford");
INSERT INTO "car_names" VALUES ("22", "Nova", "Chevrolet");
INSERT INTO "car_names" VALUES ("23", "Accord CVCC", "Honda");
INSERT INTO "car_names" VALUES ("24", "Celica", "Toyota");
INSERT INTO "cars_data" VALUES ("1", "20.0", "1985");
INSERT INTO "cars_data" VALUES ("2", "18.0", "1990");
INSERT INTO "cars_data" VALUES ("3", "30.0", "2000");
INSERT INTO "cars_data" VALUES ("4", "32.0", "2005");
INSERT INTO "cars_data" VALUES ("5", "25.0", "2010");
INSERT INTO "cars_data" VALUES ("6", "22.0", "2015");
INSERT INTO "cars_data" VALUES ("7", "28.0", "2018");
INSERT INTO "cars_data" VALUES ("8", "35.0", "2020");
INSERT INTO "cars_data" VALUES ("9", "24.0", "2021");
INSERT INTO "cars_data" VALUES ("10", "29.0", "2022");
INSERT INTO "cars_data" VALUES ("11", "15.0", "1975");
INSERT INTO "cars_data" VALUES ("12", "16.0", "1978");
INSERT INTO "cars_data" VALUES ("13", "27.0", "1981");
INSERT INTO "cars_data" VALUES ("14", "26.0", "1982");
INSERT INTO "cars_data" VALUES ("15", "23.0", "1983");
INSERT INTO "cars_data" VALUES ("16", "21.0", "1984");
INSERT INTO "cars_data" VALUES ("17", "19.0", "1986");
INSERT INTO "cars_data" VALUES ("18", "31.0", "1987");
INSERT INTO "cars_data" VALUES ("19", "20.0", "1988");
INSERT INTO "cars_data" VALUES ("20", "25.0", "1989");
INSERT INTO "cars_data" VALUES ("21", "13.0", "1972");
INSERT INTO "cars_data" VALUES ("22", "14.0", "1973");
INSERT INTO "cars_data" VALUES ("23", "25.0", "1979");
INSERT INTO "cars_data" VALUES ("24", "28.0", "1980");