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,
"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", "Toyota");
INSERT INTO "car_makers" VALUES ("2", "Honda");
INSERT INTO "car_makers" VALUES ("3", "Ford");
INSERT INTO "car_makers" VALUES ("4", "Chevrolet");
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", "Hyundai");
INSERT INTO "car_makers" VALUES ("9", "Kia");
INSERT INTO "car_makers" VALUES ("10", "Audi");
INSERT INTO "model_list" VALUES ("1", "Camry");
INSERT INTO "model_list" VALUES ("2", "Civic");
INSERT INTO "model_list" VALUES ("3", "F-150");
INSERT INTO "model_list" VALUES ("4", "Silverado");
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", "Elantra");
INSERT INTO "model_list" VALUES ("9", "Sportage");
INSERT INTO "model_list" VALUES ("10", "A4");
INSERT INTO "model_list" VALUES ("11", "Corolla");
INSERT INTO "model_list" VALUES ("12", "Accord");
INSERT INTO "model_list" VALUES ("13", "Mustang");
INSERT INTO "model_list" VALUES ("14", "Malibu");
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", "Sonata");
INSERT INTO "model_list" VALUES ("19", "Sorento");
INSERT INTO "model_list" VALUES ("20", "Q5");
INSERT INTO "model_list" VALUES ("21", "Pinto");
INSERT INTO "model_list" VALUES ("22", "Gremlin");
INSERT INTO "model_list" VALUES ("23", "Vega");
INSERT INTO "car_names" VALUES ("1", "Camry");
INSERT INTO "car_names" VALUES ("2", "Civic");
INSERT INTO "car_names" VALUES ("3", "F-150");
INSERT INTO "car_names" VALUES ("4", "Silverado");
INSERT INTO "car_names" VALUES ("5", "3 Series");
INSERT INTO "car_names" VALUES ("6", "C-Class");
INSERT INTO "car_names" VALUES ("7", "Altima");
INSERT INTO "car_names" VALUES ("8", "Elantra");
INSERT INTO "car_names" VALUES ("9", "Sportage");
INSERT INTO "car_names" VALUES ("10", "A4");
INSERT INTO "car_names" VALUES ("11", "Corolla");
INSERT INTO "car_names" VALUES ("12", "Accord");
INSERT INTO "car_names" VALUES ("13", "Mustang");
INSERT INTO "car_names" VALUES ("14", "Malibu");
INSERT INTO "car_names" VALUES ("15", "X5");
INSERT INTO "car_names" VALUES ("16", "E-Class");
INSERT INTO "car_names" VALUES ("17", "Titan");
INSERT INTO "car_names" VALUES ("18", "Sonata");
INSERT INTO "car_names" VALUES ("19", "Sorento");
INSERT INTO "car_names" VALUES ("20", "Q5");
INSERT INTO "car_names" VALUES ("21", "Pinto");
INSERT INTO "car_names" VALUES ("22", "Gremlin");
INSERT INTO "car_names" VALUES ("23", "Vega");
INSERT INTO "cars_data" VALUES ("1", "30.5", "4", "150");
INSERT INTO "cars_data" VALUES ("2", "33.0", "4", "140");
INSERT INTO "cars_data" VALUES ("3", "18.0", "8", "250");
INSERT INTO "cars_data" VALUES ("4", "17.0", "8", "280");
INSERT INTO "cars_data" VALUES ("5", "25.0", "6", "200");
INSERT INTO "cars_data" VALUES ("6", "22.0", "6", "190");
INSERT INTO "cars_data" VALUES ("7", "28.0", "4", "170");
INSERT INTO "cars_data" VALUES ("8", "31.0", "4", "160");
INSERT INTO "cars_data" VALUES ("9", "24.0", "4", "180");
INSERT INTO "cars_data" VALUES ("10", "26.0", "4", "210");
INSERT INTO "cars_data" VALUES ("11", "32.0", "4", "135");
INSERT INTO "cars_data" VALUES ("12", "29.0", "4", "155");
INSERT INTO "cars_data" VALUES ("13", "19.0", "8", "300");
INSERT INTO "cars_data" VALUES ("14", "23.0", "6", "175");
INSERT INTO "cars_data" VALUES ("15", "20.0", "8", "320");
INSERT INTO "cars_data" VALUES ("16", "21.0", "6", "220");
INSERT INTO "cars_data" VALUES ("17", "16.0", "8", "350");
INSERT INTO "cars_data" VALUES ("18", "27.0", "4", "165");
INSERT INTO "cars_data" VALUES ("19", "23.5", "6", "205");
INSERT INTO "cars_data" VALUES ("20", "25.5", "6", "230");
INSERT INTO "cars_data" VALUES ("21", "25.0", "4", "88");
INSERT INTO "cars_data" VALUES ("22", "20.0", "6", "75");
INSERT INTO "cars_data" VALUES ("23", "21.0", "4", "70");