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,
"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", "Corolla");
INSERT INTO "car_names" VALUES ("4", "Camry");
INSERT INTO "car_names" VALUES ("5", "Model S");
INSERT INTO "car_names" VALUES ("6", "Model 3");
INSERT INTO "car_names" VALUES ("7", "Mustang");
INSERT INTO "car_names" VALUES ("8", "F-150");
INSERT INTO "car_names" VALUES ("9", "Prius");
INSERT INTO "car_names" VALUES ("10", "Leaf");
INSERT INTO "cars_data" VALUES ("1", "35", "158");
INSERT INTO "cars_data" VALUES ("2", "30", "192");
INSERT INTO "cars_data" VALUES ("3", "33", "132");
INSERT INTO "cars_data" VALUES ("4", "29", "203");
INSERT INTO "cars_data" VALUES ("5", "102", "670");
INSERT INTO "cars_data" VALUES ("6", "113", "450");
INSERT INTO "cars_data" VALUES ("7", "25", "450");
INSERT INTO "cars_data" VALUES ("8", "20", "400");
INSERT INTO "cars_data" VALUES ("9", "56", "121");
INSERT INTO "cars_data" VALUES ("10", "99", "147");
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");