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

CREATE TABLE "cars_data" (
"Id" INT,
"MPG" TEXT,
"Cylinders" INT,
"Horsepower" TEXT,
"Weight" INT,
"Year" INT,
PRIMARY KEY ("Id"),
FOREIGN KEY ("Id") REFERENCES "car_names"("MakeId")
);





INSERT INTO "car_names" VALUES ("1", "Mustang");
INSERT INTO "car_names" VALUES ("2", "Camaro");
INSERT INTO "car_names" VALUES ("3", "Charger");
INSERT INTO "car_names" VALUES ("4", "Corvette");
INSERT INTO "car_names" VALUES ("5", "Impala");
INSERT INTO "car_names" VALUES ("6", "Barracuda");
INSERT INTO "car_names" VALUES ("7", "Firebird");
INSERT INTO "car_names" VALUES ("8", "Duster");
INSERT INTO "car_names" VALUES ("9", "Nova");
INSERT INTO "car_names" VALUES ("10", "Monte Carlo");
INSERT INTO "cars_data" VALUES ("1", "15", "8", "250", "3500", "1974");
INSERT INTO "cars_data" VALUES ("2", "14", "8", "300", "3700", "1974");
INSERT INTO "cars_data" VALUES ("3", "13", "8", "280", "3600", "1974");
INSERT INTO "cars_data" VALUES ("4", "16", "8", "270", "3400", "1974");
INSERT INTO "cars_data" VALUES ("5", "12", "8", "290", "3800", "1974");
INSERT INTO "cars_data" VALUES ("6", "18", "6", "200", "3200", "1974");
INSERT INTO "cars_data" VALUES ("7", "20", "4", "150", "2800", "1974");
INSERT INTO "cars_data" VALUES ("8", "22", "4", "140", "2900", "1974");
INSERT INTO "cars_data" VALUES ("9", "19", "6", "210", "3300", "1973");
INSERT INTO "cars_data" VALUES ("10", "17", "8", "260", "3550", "1975");