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,
"Cylinders" INT,
"Horsepower" TEXT,
"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", "Chevrolet");
INSERT INTO "car_makers" VALUES ("4", "Honda");
INSERT INTO "car_makers" VALUES ("5", "BMW");
INSERT INTO "car_makers" VALUES ("6", "Tesla");
INSERT INTO "car_makers" VALUES ("7", "Audi");
INSERT INTO "car_makers" VALUES ("8", "Nissan");
INSERT INTO "car_makers" VALUES ("9", "Volkswagen");
INSERT INTO "car_makers" VALUES ("10", "Subaru");
INSERT INTO "car_names" VALUES ("1", "Corolla");
INSERT INTO "car_names" VALUES ("2", "Mustang");
INSERT INTO "car_names" VALUES ("3", "Camaro");
INSERT INTO "car_names" VALUES ("4", "Civic");
INSERT INTO "car_names" VALUES ("5", "M3");
INSERT INTO "car_names" VALUES ("6", "Model S");
INSERT INTO "car_names" VALUES ("7", "A4");
INSERT INTO "car_names" VALUES ("8", "Altima");
INSERT INTO "car_names" VALUES ("9", "Golf");
INSERT INTO "car_names" VALUES ("10", "Impreza");
INSERT INTO "cars_data" VALUES ("1", "4", "132", "10.5");
INSERT INTO "cars_data" VALUES ("2", "8", "450", "5.1");
INSERT INTO "cars_data" VALUES ("3", "6", "335", "6.2");
INSERT INTO "cars_data" VALUES ("4", "4", "158", "9.8");
INSERT INTO "cars_data" VALUES ("5", "6", "425", "4.8");
INSERT INTO "cars_data" VALUES ("6", "0", "1020", "2.3");
INSERT INTO "cars_data" VALUES ("7", "4", "201", "7.1");
INSERT INTO "cars_data" VALUES ("8", "4", "188", "8.9");
INSERT INTO "cars_data" VALUES ("9", "4", "147", "9.5");
INSERT INTO "cars_data" VALUES ("10", "4", "152", "9.0");