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_names" (
"MakeId" INT UNIQUE,
"Model" TEXT,
PRIMARY KEY ("MakeId")
);

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,
"Maker" INT,
PRIMARY KEY ("ModelId")
);





INSERT INTO "car_names" VALUES ("1", "Civic");
INSERT INTO "car_names" VALUES ("2", "Accord");
INSERT INTO "car_names" VALUES ("3", "Camry");
INSERT INTO "car_names" VALUES ("4", "Mustang");
INSERT INTO "car_names" VALUES ("5", "Corolla");
INSERT INTO "car_names" VALUES ("6", "Impreza");
INSERT INTO "car_names" VALUES ("7", "Charger");
INSERT INTO "car_names" VALUES ("8", "Fiesta");
INSERT INTO "car_names" VALUES ("9", "Focus");
INSERT INTO "car_names" VALUES ("10", "Altima");
INSERT INTO "cars_data" VALUES ("1", "30", "4", "140");
INSERT INTO "cars_data" VALUES ("2", "27", "4", "190");
INSERT INTO "cars_data" VALUES ("3", "25", "6", "200");
INSERT INTO "cars_data" VALUES ("4", "20", "8", "300");
INSERT INTO "cars_data" VALUES ("5", "32", "4", "132");
INSERT INTO "cars_data" VALUES ("6", "28", "4", "152");
INSERT INTO "cars_data" VALUES ("7", "18", "8", "370");
INSERT INTO "cars_data" VALUES ("8", "35", "4", "120");
INSERT INTO "cars_data" VALUES ("9", "33", "4", "125");
INSERT INTO "cars_data" VALUES ("10", "24", "6", "180");
INSERT INTO "model_list" VALUES ("101", "1");
INSERT INTO "model_list" VALUES ("102", "2");
INSERT INTO "model_list" VALUES ("103", "3");
INSERT INTO "model_list" VALUES ("104", "4");
INSERT INTO "model_list" VALUES ("105", "5");
INSERT INTO "model_list" VALUES ("106", "6");
INSERT INTO "model_list" VALUES ("107", "7");
INSERT INTO "model_list" VALUES ("108", "8");
INSERT INTO "model_list" VALUES ("109", "9");
INSERT INTO "model_list" VALUES ("110", "10");