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

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

CREATE TABLE "model_list" (
"ModelId" INT,
"Model" TEXT UNIQUE,
PRIMARY KEY ("ModelId")
);





INSERT INTO "car_makers" VALUES ("1", "Ford");
INSERT INTO "car_makers" VALUES ("2", "Chevrolet");
INSERT INTO "car_makers" VALUES ("3", "Dodge");
INSERT INTO "car_makers" VALUES ("4", "Toyota");
INSERT INTO "car_makers" VALUES ("5", "BMW");
INSERT INTO "car_makers" VALUES ("6", "Mercedes");
INSERT INTO "car_makers" VALUES ("7", "Ferrari");
INSERT INTO "car_makers" VALUES ("8", "Lamborghini");
INSERT INTO "car_makers" VALUES ("9", "Tesla");
INSERT INTO "car_makers" VALUES ("10", "Cadillac");
INSERT INTO "car_makers" VALUES ("11", "Audi");
INSERT INTO "car_makers" VALUES ("12", "Jaguar");
INSERT INTO "car_names" VALUES ("1");
INSERT INTO "car_names" VALUES ("2");
INSERT INTO "car_names" VALUES ("3");
INSERT INTO "car_names" VALUES ("4");
INSERT INTO "car_names" VALUES ("5");
INSERT INTO "car_names" VALUES ("6");
INSERT INTO "car_names" VALUES ("7");
INSERT INTO "car_names" VALUES ("8");
INSERT INTO "car_names" VALUES ("9");
INSERT INTO "car_names" VALUES ("10");
INSERT INTO "car_names" VALUES ("11");
INSERT INTO "car_names" VALUES ("12");
INSERT INTO "cars_data" VALUES ("1", "4", "210");
INSERT INTO "cars_data" VALUES ("2", "6", "300");
INSERT INTO "cars_data" VALUES ("3", "8", "450");
INSERT INTO "cars_data" VALUES ("4", "4", "180");
INSERT INTO "cars_data" VALUES ("5", "12", "600");
INSERT INTO "cars_data" VALUES ("6", "10", "550");
INSERT INTO "cars_data" VALUES ("7", "8", "700");
INSERT INTO "cars_data" VALUES ("8", "16", "1000");
INSERT INTO "cars_data" VALUES ("9", "0", "Electric");
INSERT INTO "cars_data" VALUES ("10", "6", "400");
INSERT INTO "cars_data" VALUES ("11", "5", "320");
INSERT INTO "cars_data" VALUES ("12", "3", "250");
INSERT INTO "model_list" VALUES ("1", "Mustang");
INSERT INTO "model_list" VALUES ("2", "Camaro");
INSERT INTO "model_list" VALUES ("3", "Charger");
INSERT INTO "model_list" VALUES ("4", "Corolla");
INSERT INTO "model_list" VALUES ("5", "M5");
INSERT INTO "model_list" VALUES ("6", "S-Class");
INSERT INTO "model_list" VALUES ("7", "488 Spider");
INSERT INTO "model_list" VALUES ("8", "Aventador");
INSERT INTO "model_list" VALUES ("9", "Model S");
INSERT INTO "model_list" VALUES ("10", "Escalade");
INSERT INTO "model_list" VALUES ("11", "A6");
INSERT INTO "model_list" VALUES ("12", "F-Type");