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,
"Cylinders" INT,
"Weight" 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", "Toyota");
INSERT INTO "car_makers" VALUES ("4", "Honda");
INSERT INTO "car_makers" VALUES ("5", "BMW");
INSERT INTO "car_makers" VALUES ("6", "Mercedes-Benz");
INSERT INTO "car_makers" VALUES ("7", "Audi");
INSERT INTO "car_makers" VALUES ("8", "Nissan");
INSERT INTO "car_makers" VALUES ("9", "Hyundai");
INSERT INTO "car_makers" VALUES ("10", "Kia");
INSERT INTO "model_list" VALUES ("1", "F-150");
INSERT INTO "model_list" VALUES ("2", "Silverado");
INSERT INTO "model_list" VALUES ("3", "Camry");
INSERT INTO "model_list" VALUES ("4", "Civic");
INSERT INTO "model_list" VALUES ("5", "3 Series");
INSERT INTO "model_list" VALUES ("6", "C-Class");
INSERT INTO "model_list" VALUES ("7", "A4");
INSERT INTO "model_list" VALUES ("8", "Altima");
INSERT INTO "model_list" VALUES ("9", "Elantra");
INSERT INTO "model_list" VALUES ("10", "Sportage");
INSERT INTO "model_list" VALUES ("11", "Mustang");
INSERT INTO "model_list" VALUES ("12", "Corvette");
INSERT INTO "model_list" VALUES ("13", "Accord");
INSERT INTO "model_list" VALUES ("14", "X5");
INSERT INTO "model_list" VALUES ("15", "E-Class");
INSERT INTO "model_list" VALUES ("16", "Q5");
INSERT INTO "model_list" VALUES ("17", "Titan");
INSERT INTO "model_list" VALUES ("18", "Sonata");
INSERT INTO "model_list" VALUES ("19", "Sorento");
INSERT INTO "model_list" VALUES ("20", "Explorer");
INSERT INTO "car_names" VALUES ("1", "F-150", "Ford");
INSERT INTO "car_names" VALUES ("2", "Silverado", "Chevrolet");
INSERT INTO "car_names" VALUES ("3", "Camry", "Toyota");
INSERT INTO "car_names" VALUES ("4", "Civic", "Honda");
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", "A4", "Audi");
INSERT INTO "car_names" VALUES ("8", "Altima", "Nissan");
INSERT INTO "car_names" VALUES ("9", "Elantra", "Hyundai");
INSERT INTO "car_names" VALUES ("10", "Sportage", "Kia");
INSERT INTO "car_names" VALUES ("11", "Mustang", "Ford");
INSERT INTO "car_names" VALUES ("12", "Corvette", "Chevrolet");
INSERT INTO "car_names" VALUES ("13", "Accord", "Honda");
INSERT INTO "car_names" VALUES ("14", "X5", "BMW");
INSERT INTO "car_names" VALUES ("15", "E-Class", "Mercedes-Benz");
INSERT INTO "car_names" VALUES ("16", "Q5", "Audi");
INSERT INTO "car_names" VALUES ("17", "Titan", "Nissan");
INSERT INTO "car_names" VALUES ("18", "Sonata", "Hyundai");
INSERT INTO "car_names" VALUES ("19", "Sorento", "Kia");
INSERT INTO "car_names" VALUES ("20", "Explorer", "Ford");
INSERT INTO "cars_data" VALUES ("1", "6", "4500");
INSERT INTO "cars_data" VALUES ("2", "8", "5000");
INSERT INTO "cars_data" VALUES ("3", "4", "3300");
INSERT INTO "cars_data" VALUES ("4", "4", "2800");
INSERT INTO "cars_data" VALUES ("5", "6", "3600");
INSERT INTO "cars_data" VALUES ("6", "4", "3500");
INSERT INTO "cars_data" VALUES ("7", "4", "3400");
INSERT INTO "cars_data" VALUES ("8", "4", "3200");
INSERT INTO "cars_data" VALUES ("9", "4", "2900");
INSERT INTO "cars_data" VALUES ("10", "4", "3700");
INSERT INTO "cars_data" VALUES ("11", "8", "3800");
INSERT INTO "cars_data" VALUES ("12", "8", "3500");
INSERT INTO "cars_data" VALUES ("13", "4", "3100");
INSERT INTO "cars_data" VALUES ("14", "6", "4800");
INSERT INTO "cars_data" VALUES ("15", "6", "4000");
INSERT INTO "cars_data" VALUES ("16", "4", "4100");
INSERT INTO "cars_data" VALUES ("17", "8", "5200");
INSERT INTO "cars_data" VALUES ("18", "4", "3000");
INSERT INTO "cars_data" VALUES ("19", "6", "4200");
INSERT INTO "cars_data" VALUES ("20", "6", "4600");