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

CREATE TABLE "cars_data" (
"Id" INT,
"Horsepower" TEXT,
"Accelerate" FLOAT,
PRIMARY KEY ("Id"),
FOREIGN KEY ("Id") REFERENCES "car_names"("MakeId")
);

CREATE TABLE "model_list" (
"ModelId" INT,
"Maker" INT,
PRIMARY KEY ("ModelId"),
FOREIGN KEY ("Maker") REFERENCES "car_makers"("Id")
);





INSERT INTO "car_makers" VALUES ("1", "amc");
INSERT INTO "car_makers" VALUES ("2", "ford");
INSERT INTO "car_makers" VALUES ("3", "chevrolet");
INSERT INTO "car_makers" VALUES ("4", "plymouth");
INSERT INTO "car_makers" VALUES ("5", "dodge");
INSERT INTO "car_makers" VALUES ("6", "toyota");
INSERT INTO "car_makers" VALUES ("7", "honda");
INSERT INTO "car_makers" VALUES ("8", "volkswagen");
INSERT INTO "car_makers" VALUES ("9", "mercedes-benz");
INSERT INTO "car_makers" VALUES ("10", "bmw");
INSERT INTO "car_names" VALUES ("1", "hornet sportabout sw", "amc");
INSERT INTO "car_names" VALUES ("2", "gremlin", "amc");
INSERT INTO "car_names" VALUES ("3", "matador sw", "amc");
INSERT INTO "car_names" VALUES ("4", "pinto", "ford");
INSERT INTO "car_names" VALUES ("5", "maverick", "ford");
INSERT INTO "car_names" VALUES ("6", "vega 2300", "chevrolet");
INSERT INTO "car_names" VALUES ("7", "satellite custom sw", "plymouth");
INSERT INTO "car_names" VALUES ("8", "valiant", "plymouth");
INSERT INTO "car_names" VALUES ("9", "challenger", "dodge");
INSERT INTO "car_names" VALUES ("10", "corolla 1200", "toyota");
INSERT INTO "car_names" VALUES ("11", "civic", "honda");
INSERT INTO "car_names" VALUES ("12", "super beetle", "volkswagen");
INSERT INTO "car_names" VALUES ("13", "240d", "mercedes-benz");
INSERT INTO "car_names" VALUES ("14", "3.0si", "bmw");
INSERT INTO "car_names" VALUES ("15", "hornet", "amc");
INSERT INTO "car_names" VALUES ("16", "mustang", "ford");
INSERT INTO "car_names" VALUES ("17", "camaro", "chevrolet");
INSERT INTO "car_names" VALUES ("18", "barracuda", "plymouth");
INSERT INTO "car_names" VALUES ("19", "charger", "dodge");
INSERT INTO "car_names" VALUES ("20", "celica", "toyota");
INSERT INTO "cars_data" VALUES ("1", "100", "16.0");
INSERT INTO "cars_data" VALUES ("2", "90", "14.5");
INSERT INTO "cars_data" VALUES ("3", "150", "13.0");
INSERT INTO "cars_data" VALUES ("4", "75", "19.0");
INSERT INTO "cars_data" VALUES ("5", "95", "15.5");
INSERT INTO "cars_data" VALUES ("6", "88", "17.0");
INSERT INTO "cars_data" VALUES ("7", "105", "14.0");
INSERT INTO "cars_data" VALUES ("8", "97", "16.5");
INSERT INTO "cars_data" VALUES ("9", "140", "12.0");
INSERT INTO "cars_data" VALUES ("10", "65", "18.0");
INSERT INTO "cars_data" VALUES ("11", "60", "19.5");
INSERT INTO "cars_data" VALUES ("12", "70", "17.5");
INSERT INTO "cars_data" VALUES ("13", "62", "21.0");
INSERT INTO "cars_data" VALUES ("14", "120", "11.5");
INSERT INTO "cars_data" VALUES ("15", "110", "15.0");
INSERT INTO "cars_data" VALUES ("16", "130", "13.5");
INSERT INTO "cars_data" VALUES ("17", "160", "11.0");
INSERT INTO "cars_data" VALUES ("18", "125", "12.5");
INSERT INTO "cars_data" VALUES ("19", "170", "10.5");
INSERT INTO "cars_data" VALUES ("20", "80", "16.0");
INSERT INTO "model_list" VALUES ("1", "1");
INSERT INTO "model_list" VALUES ("2", "1");
INSERT INTO "model_list" VALUES ("3", "1");
INSERT INTO "model_list" VALUES ("4", "2");
INSERT INTO "model_list" VALUES ("5", "2");
INSERT INTO "model_list" VALUES ("6", "3");
INSERT INTO "model_list" VALUES ("7", "4");
INSERT INTO "model_list" VALUES ("8", "4");
INSERT INTO "model_list" VALUES ("9", "5");
INSERT INTO "model_list" VALUES ("10", "6");
INSERT INTO "model_list" VALUES ("11", "7");
INSERT INTO "model_list" VALUES ("12", "8");
INSERT INTO "model_list" VALUES ("13", "9");
INSERT INTO "model_list" VALUES ("14", "10");
INSERT INTO "model_list" VALUES ("15", "1");
INSERT INTO "model_list" VALUES ("16", "2");
INSERT INTO "model_list" VALUES ("17", "3");
INSERT INTO "model_list" VALUES ("18", "4");
INSERT INTO "model_list" VALUES ("19", "5");
INSERT INTO "model_list" VALUES ("20", "6");