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,
"Weight" INT,
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", "Toyota");
INSERT INTO "car_makers" VALUES ("2", "Honda");
INSERT INTO "car_makers" VALUES ("3", "Ford");
INSERT INTO "car_makers" VALUES ("4", "Chevrolet");
INSERT INTO "car_makers" VALUES ("5", "BMW");
INSERT INTO "car_makers" VALUES ("6", "Mercedes-Benz");
INSERT INTO "car_makers" VALUES ("7", "Audi");
INSERT INTO "car_makers" VALUES ("8", "Nissan");
INSERT INTO "car_makers" VALUES ("9", "Hyundai");
INSERT INTO "car_makers" VALUES ("10", "Kia");
INSERT INTO "car_names" VALUES ("1", "Camry");
INSERT INTO "car_names" VALUES ("2", "Civic");
INSERT INTO "car_names" VALUES ("3", "F-150");
INSERT INTO "car_names" VALUES ("4", "Silverado");
INSERT INTO "car_names" VALUES ("5", "3 Series");
INSERT INTO "car_names" VALUES ("6", "C-Class");
INSERT INTO "car_names" VALUES ("7", "A4");
INSERT INTO "car_names" VALUES ("8", "Altima");
INSERT INTO "car_names" VALUES ("9", "Elantra");
INSERT INTO "car_names" VALUES ("10", "Sportage");
INSERT INTO "car_names" VALUES ("11", "Corolla");
INSERT INTO "car_names" VALUES ("12", "Accord");
INSERT INTO "car_names" VALUES ("13", "Mustang");
INSERT INTO "car_names" VALUES ("14", "Malibu");
INSERT INTO "car_names" VALUES ("15", "X5");
INSERT INTO "cars_data" VALUES ("1", "203", "3300");
INSERT INTO "cars_data" VALUES ("2", "158", "2800");
INSERT INTO "cars_data" VALUES ("3", "395", "4900");
INSERT INTO "cars_data" VALUES ("4", "355", "5200");
INSERT INTO "cars_data" VALUES ("5", "255", "3500");
INSERT INTO "cars_data" VALUES ("6", "201", "3600");
INSERT INTO "cars_data" VALUES ("7", "201", "3400");
INSERT INTO "cars_data" VALUES ("8", "188", "3200");
INSERT INTO "cars_data" VALUES ("9", "147", "2900");
INSERT INTO "cars_data" VALUES ("10", "181", "3700");
INSERT INTO "cars_data" VALUES ("11", "169", "3000");
INSERT INTO "cars_data" VALUES ("12", "192", "3100");
INSERT INTO "cars_data" VALUES ("13", "310", "3700");
INSERT INTO "cars_data" VALUES ("14", "160", "3300");
INSERT INTO "cars_data" VALUES ("15", "335", "4800");
INSERT INTO "model_list" VALUES ("1", "1");
INSERT INTO "model_list" VALUES ("2", "2");
INSERT INTO "model_list" VALUES ("3", "3");
INSERT INTO "model_list" VALUES ("4", "4");
INSERT INTO "model_list" VALUES ("5", "5");
INSERT INTO "model_list" VALUES ("6", "6");
INSERT INTO "model_list" VALUES ("7", "7");
INSERT INTO "model_list" VALUES ("8", "8");
INSERT INTO "model_list" VALUES ("9", "9");
INSERT INTO "model_list" VALUES ("10", "10");
INSERT INTO "model_list" VALUES ("11", "1");
INSERT INTO "model_list" VALUES ("12", "2");
INSERT INTO "model_list" VALUES ("13", "3");
INSERT INTO "model_list" VALUES ("14", "4");
INSERT INTO "model_list" VALUES ("15", "5");