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

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





INSERT INTO "car_makers" VALUES ("1", "Toyota");
INSERT INTO "car_makers" VALUES ("2", "Ford");
INSERT INTO "car_makers" VALUES ("3", "BMW");
INSERT INTO "car_makers" VALUES ("4", "Tesla");
INSERT INTO "car_makers" VALUES ("5", "Honda");
INSERT INTO "car_names" VALUES ("1", "Corolla");
INSERT INTO "car_names" VALUES ("2", "Mustang");
INSERT INTO "car_names" VALUES ("3", "X5");
INSERT INTO "car_names" VALUES ("4", "Model S");
INSERT INTO "car_names" VALUES ("5", "Civic");
INSERT INTO "cars_data" VALUES ("1", "132 HP", "2800", "8.5");
INSERT INTO "cars_data" VALUES ("2", "450 HP", "3700", "4.3");
INSERT INTO "cars_data" VALUES ("3", "300 HP", "4800", "6.2");
INSERT INTO "cars_data" VALUES ("4", "670 HP", "4900", "2.9");
INSERT INTO "cars_data" VALUES ("5", "158 HP", "2700", "9.0");