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,
"Cylinders" INT,
"Horsepower" TEXT,
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", "Mustang");
INSERT INTO "model_list" VALUES ("2", "Camaro");
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", "Jetta");
INSERT INTO "model_list" VALUES ("9", "A4");
INSERT INTO "model_list" VALUES ("10", "Elantra");
INSERT INTO "model_list" VALUES ("11", "Focus");
INSERT INTO "model_list" VALUES ("12", "Accord");
INSERT INTO "model_list" VALUES ("13", "Prius");
INSERT INTO "model_list" VALUES ("14", "X3");
INSERT INTO "model_list" VALUES ("15", "E-Class");
INSERT INTO "model_list" VALUES ("16", "Sentra");
INSERT INTO "model_list" VALUES ("17", "Golf");
INSERT INTO "model_list" VALUES ("18", "Q5");
INSERT INTO "model_list" VALUES ("19", "Sonata");
INSERT INTO "model_list" VALUES ("20", "Fusion");
INSERT INTO "model_list" VALUES ("21", "CR-V");
INSERT INTO "model_list" VALUES ("22", "RAV4");
INSERT INTO "model_list" VALUES ("23", "C-HR");
INSERT INTO "model_list" VALUES ("24", "Impreza");
INSERT INTO "model_list" VALUES ("25", "Forte");
INSERT INTO "car_names" VALUES ("1", "Mustang", "Ford");
INSERT INTO "car_names" VALUES ("2", "Camaro", "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", "Jetta", "Volkswagen");
INSERT INTO "car_names" VALUES ("9", "A4", "Audi");
INSERT INTO "car_names" VALUES ("10", "Elantra", "Hyundai");
INSERT INTO "car_names" VALUES ("11", "Focus", "Ford");
INSERT INTO "car_names" VALUES ("12", "Accord", "Honda");
INSERT INTO "car_names" VALUES ("13", "Prius", "Toyota");
INSERT INTO "car_names" VALUES ("14", "X3", "BMW");
INSERT INTO "car_names" VALUES ("15", "E-Class", "Mercedes-Benz");
INSERT INTO "car_names" VALUES ("16", "Sentra", "Nissan");
INSERT INTO "car_names" VALUES ("17", "Golf", "Volkswagen");
INSERT INTO "car_names" VALUES ("18", "Q5", "Audi");
INSERT INTO "car_names" VALUES ("19", "Sonata", "Hyundai");
INSERT INTO "car_names" VALUES ("20", "Fusion", "Ford");
INSERT INTO "car_names" VALUES ("21", "CR-V", "Honda");
INSERT INTO "car_names" VALUES ("22", "RAV4", "Toyota");
INSERT INTO "car_names" VALUES ("23", "C-HR", "Toyota");
INSERT INTO "car_names" VALUES ("24", "Impreza", "Subaru");
INSERT INTO "car_names" VALUES ("25", "Forte", "Kia");
INSERT INTO "cars_data" VALUES ("1", "20", "6", "300");
INSERT INTO "cars_data" VALUES ("2", "18", "8", "450");
INSERT INTO "cars_data" VALUES ("3", "35", "4", "158");
INSERT INTO "cars_data" VALUES ("4", "32", "4", "139");
INSERT INTO "cars_data" VALUES ("5", "28", "6", "255");
INSERT INTO "cars_data" VALUES ("6", "25", "6", "200");
INSERT INTO "cars_data" VALUES ("7", "29", "4", "188");
INSERT INTO "cars_data" VALUES ("8", "30", "4", "150");
INSERT INTO "cars_data" VALUES ("9", "27", "4", "201");
INSERT INTO "cars_data" VALUES ("10", "33", "4", "147");
INSERT INTO "cars_data" VALUES ("11", "28", "4", "160");
INSERT INTO "cars_data" VALUES ("12", "30", "4", "192");
INSERT INTO "cars_data" VALUES ("13", "50", "4", "121");
INSERT INTO "cars_data" VALUES ("14", "24", "4", "248");
INSERT INTO "cars_data" VALUES ("15", "22", "6", "255");
INSERT INTO "cars_data" VALUES ("16", "31", "4", "149");
INSERT INTO "cars_data" VALUES ("17", "30", "4", "147");
INSERT INTO "cars_data" VALUES ("18", "26", "4", "201");
INSERT INTO "cars_data" VALUES ("19", "30", "4", "191");
INSERT INTO "cars_data" VALUES ("20", "26", "4", "181");
INSERT INTO "cars_data" VALUES ("21", "28", "4", "190");
INSERT INTO "cars_data" VALUES ("22", "29", "4", "203");
INSERT INTO "cars_data" VALUES ("23", "31", "4", "144");
INSERT INTO "cars_data" VALUES ("24", "28", "4", "152");
INSERT INTO "cars_data" VALUES ("25", "30", "4", "147");