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 UNIQUE,
"Maker" TEXT,
"FullName" TEXT,
PRIMARY KEY ("Id")
);

CREATE TABLE "car_names" (
"MakeId" INT,
"Make" TEXT,
PRIMARY KEY ("MakeId")
);

CREATE TABLE "model_list" (
"ModelId" INT,
"Maker" INT,
"Model" TEXT UNIQUE,
PRIMARY KEY ("ModelId"),
FOREIGN KEY ("Maker") REFERENCES "car_makers"("Id")
);





INSERT INTO "car_makers" VALUES ("1", "Toyota", "Toyota Motor Corporation");
INSERT INTO "car_makers" VALUES ("2", "Ford", "Ford Motor Company");
INSERT INTO "car_makers" VALUES ("3", "BMW", "Bayerische Motoren Werke AG");
INSERT INTO "car_makers" VALUES ("4", "Tesla", "Tesla, Inc.");
INSERT INTO "car_makers" VALUES ("5", "Hyundai", "Hyundai Motor Company");
INSERT INTO "car_makers" VALUES ("6", "Volkswagen", "Volkswagen AG");
INSERT INTO "car_makers" VALUES ("7", "Ferrari", "Ferrari N.V.");
INSERT INTO "car_makers" VALUES ("8", "Nissan", "Nissan Motor Corporation");
INSERT INTO "car_makers" VALUES ("9", "Chevrolet", "Chevrolet Division of General Motors");
INSERT INTO "car_makers" VALUES ("10", "Subaru", "Subaru Corporation");
INSERT INTO "car_names" VALUES ("1", "Toyota");
INSERT INTO "car_names" VALUES ("2", "Ford");
INSERT INTO "car_names" VALUES ("3", "BMW");
INSERT INTO "car_names" VALUES ("4", "Tesla");
INSERT INTO "car_names" VALUES ("5", "Hyundai");
INSERT INTO "car_names" VALUES ("6", "Volkswagen");
INSERT INTO "car_names" VALUES ("7", "Ferrari");
INSERT INTO "car_names" VALUES ("8", "Nissan");
INSERT INTO "car_names" VALUES ("9", "Chevrolet");
INSERT INTO "car_names" VALUES ("10", "Subaru");
INSERT INTO "model_list" VALUES ("101", "1", "Corolla");
INSERT INTO "model_list" VALUES ("102", "1", "Camry");
INSERT INTO "model_list" VALUES ("103", "1", "Prius");
INSERT INTO "model_list" VALUES ("201", "2", "F-150");
INSERT INTO "model_list" VALUES ("202", "2", "Mustang");
INSERT INTO "model_list" VALUES ("203", "2", "Explorer");
INSERT INTO "model_list" VALUES ("301", "3", "3 Series");
INSERT INTO "model_list" VALUES ("302", "3", "X5");
INSERT INTO "model_list" VALUES ("303", "3", "i8");
INSERT INTO "model_list" VALUES ("401", "4", "Model S");
INSERT INTO "model_list" VALUES ("402", "4", "Model 3");
INSERT INTO "model_list" VALUES ("403", "4", "Model X");
INSERT INTO "model_list" VALUES ("501", "5", "Elantra");
INSERT INTO "model_list" VALUES ("502", "5", "Santa Fe");
INSERT INTO "model_list" VALUES ("503", "5", "Tucson");
INSERT INTO "model_list" VALUES ("601", "6", "Golf");
INSERT INTO "model_list" VALUES ("602", "6", "Passat");
INSERT INTO "model_list" VALUES ("603", "6", "Tiguan");
INSERT INTO "model_list" VALUES ("701", "7", "488 GTB");
INSERT INTO "model_list" VALUES ("702", "7", "Portofino");
INSERT INTO "model_list" VALUES ("801", "8", "Altima");
INSERT INTO "model_list" VALUES ("802", "8", "Leaf");
INSERT INTO "model_list" VALUES ("803", "8", "GT-R");
INSERT INTO "model_list" VALUES ("901", "9", "Silverado");
INSERT INTO "model_list" VALUES ("902", "9", "Camaro");
INSERT INTO "model_list" VALUES ("903", "9", "Equinox");
INSERT INTO "model_list" VALUES ("1001", "10", "Impreza");
INSERT INTO "model_list" VALUES ("1002", "10", "Outback");
INSERT INTO "model_list" VALUES ("1003", "10", "Forester");