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,
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,
"Weight" INT,
"Year" INT,
PRIMARY KEY ("Id"),
FOREIGN KEY ("Id") REFERENCES "car_names"("MakeId")
);

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





INSERT INTO "car_makers" VALUES ("1", "ford", "Ford Motor Company");
INSERT INTO "car_makers" VALUES ("2", "honda", "Honda Motor Co.");
INSERT INTO "car_makers" VALUES ("3", "toyota", "Toyota Motor Corporation");
INSERT INTO "car_makers" VALUES ("4", "nissan", "Nissan Motor Co.");
INSERT INTO "car_makers" VALUES ("5", "bmw", "Bayerische Motoren Werke AG");
INSERT INTO "car_makers" VALUES ("6", "mercedes", "Mercedes-Benz Group AG");
INSERT INTO "car_makers" VALUES ("7", "audi", "Audi AG");
INSERT INTO "car_makers" VALUES ("8", "volkswagen", "Volkswagen AG");
INSERT INTO "car_makers" VALUES ("9", "chevrolet", "Chevrolet");
INSERT INTO "car_makers" VALUES ("10", "dodge", "Dodge");
INSERT INTO "model_list" VALUES ("101", "1", "Mustang");
INSERT INTO "model_list" VALUES ("102", "1", "F-150");
INSERT INTO "model_list" VALUES ("103", "2", "Civic");
INSERT INTO "model_list" VALUES ("104", "2", "CR-V");
INSERT INTO "model_list" VALUES ("105", "3", "Camry");
INSERT INTO "model_list" VALUES ("106", "3", "RAV4");
INSERT INTO "model_list" VALUES ("107", "4", "Altima");
INSERT INTO "model_list" VALUES ("108", "4", "Rogue");
INSERT INTO "model_list" VALUES ("109", "5", "3 Series");
INSERT INTO "model_list" VALUES ("110", "5", "X5");
INSERT INTO "model_list" VALUES ("111", "6", "C-Class");
INSERT INTO "model_list" VALUES ("112", "6", "E-Class");
INSERT INTO "model_list" VALUES ("113", "7", "A4");
INSERT INTO "model_list" VALUES ("114", "7", "Q5");
INSERT INTO "model_list" VALUES ("115", "8", "Golf");
INSERT INTO "model_list" VALUES ("116", "8", "Jetta");
INSERT INTO "model_list" VALUES ("117", "9", "Silverado");
INSERT INTO "model_list" VALUES ("118", "9", "Malibu");
INSERT INTO "model_list" VALUES ("119", "10", "Charger");
INSERT INTO "model_list" VALUES ("120", "10", "Ram 1500");
INSERT INTO "model_list" VALUES ("121", "2", "Accord");
INSERT INTO "model_list" VALUES ("122", "3", "Corolla");
INSERT INTO "model_list" VALUES ("123", "1", "Explorer");
INSERT INTO "model_list" VALUES ("124", "5", "5 Series");
INSERT INTO "model_list" VALUES ("125", "7", "A6");
INSERT INTO "car_names" VALUES ("1", "Mustang");
INSERT INTO "car_names" VALUES ("2", "Civic");
INSERT INTO "car_names" VALUES ("3", "Camry");
INSERT INTO "car_names" VALUES ("4", "Altima");
INSERT INTO "car_names" VALUES ("5", "3 Series");
INSERT INTO "car_names" VALUES ("6", "C-Class");
INSERT INTO "car_names" VALUES ("7", "A4");
INSERT INTO "car_names" VALUES ("8", "Golf");
INSERT INTO "car_names" VALUES ("9", "Silverado");
INSERT INTO "car_names" VALUES ("10", "Charger");
INSERT INTO "car_names" VALUES ("11", "F-150");
INSERT INTO "car_names" VALUES ("12", "CR-V");
INSERT INTO "car_names" VALUES ("13", "RAV4");
INSERT INTO "car_names" VALUES ("14", "Rogue");
INSERT INTO "car_names" VALUES ("15", "X5");
INSERT INTO "car_names" VALUES ("16", "E-Class");
INSERT INTO "car_names" VALUES ("17", "Q5");
INSERT INTO "car_names" VALUES ("18", "Jetta");
INSERT INTO "car_names" VALUES ("19", "Malibu");
INSERT INTO "car_names" VALUES ("20", "Ram 1500");
INSERT INTO "car_names" VALUES ("21", "Accord");
INSERT INTO "car_names" VALUES ("22", "Corolla");
INSERT INTO "car_names" VALUES ("23", "Explorer");
INSERT INTO "car_names" VALUES ("24", "5 Series");
INSERT INTO "car_names" VALUES ("25", "A6");
INSERT INTO "cars_data" VALUES ("1", "3400", "2020");
INSERT INTO "cars_data" VALUES ("2", "2800", "2021");
INSERT INTO "cars_data" VALUES ("3", "3300", "2022");
INSERT INTO "cars_data" VALUES ("4", "3200", "2020");
INSERT INTO "cars_data" VALUES ("5", "3600", "2021");
INSERT INTO "cars_data" VALUES ("6", "3800", "2022");
INSERT INTO "cars_data" VALUES ("7", "3500", "2020");
INSERT INTO "cars_data" VALUES ("8", "2900", "2021");
INSERT INTO "cars_data" VALUES ("9", "4500", "2022");
INSERT INTO "cars_data" VALUES ("10", "4200", "2020");
INSERT INTO "cars_data" VALUES ("11", "4800", "2021");
INSERT INTO "cars_data" VALUES ("12", "3450", "2022");
INSERT INTO "cars_data" VALUES ("13", "3650", "2020");
INSERT INTO "cars_data" VALUES ("14", "3100", "2021");
INSERT INTO "cars_data" VALUES ("15", "4100", "2022");
INSERT INTO "cars_data" VALUES ("16", "4000", "2020");
INSERT INTO "cars_data" VALUES ("17", "3700", "2021");
INSERT INTO "cars_data" VALUES ("18", "3000", "2022");
INSERT INTO "cars_data" VALUES ("19", "3900", "2020");
INSERT INTO "cars_data" VALUES ("20", "5000", "2021");
INSERT INTO "cars_data" VALUES ("21", "3150", "2022");
INSERT INTO "cars_data" VALUES ("22", "2700", "2020");
INSERT INTO "cars_data" VALUES ("23", "4300", "2021");
INSERT INTO "cars_data" VALUES ("24", "3750", "2022");
INSERT INTO "cars_data" VALUES ("25", "3600", "2020");