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

CREATE TABLE "cars_data" (
"Id" INT,
"Horsepower" TEXT,
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", "Honda");
INSERT INTO "car_makers" VALUES ("5", "Chevrolet");
INSERT INTO "car_makers" VALUES ("6", "Audi");
INSERT INTO "car_makers" VALUES ("7", "Nissan");
INSERT INTO "car_makers" VALUES ("8", "Volkswagen");
INSERT INTO "car_makers" VALUES ("9", "Hyundai");
INSERT INTO "car_makers" VALUES ("10", "Kia");
INSERT INTO "car_names" VALUES ("1", "Corolla");
INSERT INTO "car_names" VALUES ("2", "Mustang");
INSERT INTO "car_names" VALUES ("3", "M3");
INSERT INTO "car_names" VALUES ("4", "Civic");
INSERT INTO "car_names" VALUES ("5", "Camaro");
INSERT INTO "car_names" VALUES ("6", "A4");
INSERT INTO "car_names" VALUES ("7", "Altima");
INSERT INTO "car_names" VALUES ("8", "Golf");
INSERT INTO "car_names" VALUES ("9", "Elantra");
INSERT INTO "car_names" VALUES ("10", "Sorento");
INSERT INTO "cars_data" VALUES ("1", "132");
INSERT INTO "cars_data" VALUES ("2", "450");
INSERT INTO "cars_data" VALUES ("3", "425");
INSERT INTO "cars_data" VALUES ("4", "158");
INSERT INTO "cars_data" VALUES ("5", "275");
INSERT INTO "cars_data" VALUES ("6", "188");
INSERT INTO "cars_data" VALUES ("7", "182");
INSERT INTO "cars_data" VALUES ("8", "147");
INSERT INTO "cars_data" VALUES ("9", "147");
INSERT INTO "cars_data" VALUES ("10", "191");