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,
"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", "Mustang");
INSERT INTO "car_names" VALUES ("2", "Camaro");
INSERT INTO "car_names" VALUES ("3", "Civic");
INSERT INTO "car_names" VALUES ("4", "Accord");
INSERT INTO "car_names" VALUES ("5", "Corvette");
INSERT INTO "car_names" VALUES ("6", "Charger");
INSERT INTO "car_names" VALUES ("7", "Model S");
INSERT INTO "car_names" VALUES ("8", "F-150");
INSERT INTO "car_names" VALUES ("9", "Wrangler");
INSERT INTO "car_names" VALUES ("10", "Impreza");
INSERT INTO "cars_data" VALUES ("1", "8", "450");
INSERT INTO "cars_data" VALUES ("2", "8", "455");
INSERT INTO "cars_data" VALUES ("3", "4", "158");
INSERT INTO "cars_data" VALUES ("4", "4", "192");
INSERT INTO "cars_data" VALUES ("5", "8", "495");
INSERT INTO "cars_data" VALUES ("6", "6", "292");
INSERT INTO "cars_data" VALUES ("7", "0", "670");
INSERT INTO "cars_data" VALUES ("8", "6", "290");
INSERT INTO "cars_data" VALUES ("9", "6", "285");
INSERT INTO "cars_data" VALUES ("10", "4", "152");
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");