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,
"Model" TEXT,
"Make" TEXT,
PRIMARY KEY ("MakeId"),
FOREIGN KEY ("Model") REFERENCES "model_list"("Model")
);

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", "Honda", "Honda Motor Co.");
INSERT INTO "car_makers" VALUES ("2", "Toyota", "Toyota Motor Corporation");
INSERT INTO "car_makers" VALUES ("3", "Ford", "Ford Motor Company");
INSERT INTO "car_makers" VALUES ("4", "BMW", "Bayerische Motoren Werke AG");
INSERT INTO "car_makers" VALUES ("5", "Mercedes-Benz", "Mercedes-Benz Group AG");
INSERT INTO "car_makers" VALUES ("6", "Nissan", "Nissan Motor Co., Ltd.");
INSERT INTO "car_makers" VALUES ("7", "Audi", "Audi AG");
INSERT INTO "car_makers" VALUES ("8", "Hyundai", "Hyundai Motor Company");
INSERT INTO "car_makers" VALUES ("9", "Kia", "Kia Corporation");
INSERT INTO "car_makers" VALUES ("10", "Volkswagen", "Volkswagen AG");
INSERT INTO "model_list" VALUES ("101", "1", "Civic");
INSERT INTO "model_list" VALUES ("102", "1", "CR-V");
INSERT INTO "model_list" VALUES ("103", "1", "Accord");
INSERT INTO "model_list" VALUES ("104", "1", "Pilot");
INSERT INTO "model_list" VALUES ("201", "2", "Camry");
INSERT INTO "model_list" VALUES ("202", "2", "RAV4");
INSERT INTO "model_list" VALUES ("203", "2", "Corolla");
INSERT INTO "model_list" VALUES ("204", "2", "Highlander");
INSERT INTO "model_list" VALUES ("301", "3", "F-150");
INSERT INTO "model_list" VALUES ("302", "3", "Escape");
INSERT INTO "model_list" VALUES ("303", "3", "Mustang");
INSERT INTO "model_list" VALUES ("401", "4", "3 Series");
INSERT INTO "model_list" VALUES ("402", "4", "X5");
INSERT INTO "model_list" VALUES ("501", "5", "C-Class");
INSERT INTO "model_list" VALUES ("502", "5", "E-Class");
INSERT INTO "model_list" VALUES ("601", "6", "Altima");
INSERT INTO "model_list" VALUES ("602", "6", "Rogue");
INSERT INTO "model_list" VALUES ("701", "7", "A4");
INSERT INTO "model_list" VALUES ("801", "8", "Elantra");
INSERT INTO "model_list" VALUES ("901", "9", "Sportage");
INSERT INTO "model_list" VALUES ("1001", "10", "Jetta");
INSERT INTO "model_list" VALUES ("1002", "10", "Golf");
INSERT INTO "model_list" VALUES ("1003", "10", "Passat");
INSERT INTO "model_list" VALUES ("1004", "10", "Tiguan");
INSERT INTO "model_list" VALUES ("1005", "10", "Atlas");
INSERT INTO "car_names" VALUES ("101", "Civic", "Honda");
INSERT INTO "car_names" VALUES ("102", "CR-V", "Honda");
INSERT INTO "car_names" VALUES ("103", "Accord", "Honda");
INSERT INTO "car_names" VALUES ("104", "Pilot", "Honda");
INSERT INTO "car_names" VALUES ("201", "Camry", "Toyota");
INSERT INTO "car_names" VALUES ("202", "RAV4", "Toyota");
INSERT INTO "car_names" VALUES ("203", "Corolla", "Toyota");
INSERT INTO "car_names" VALUES ("204", "Highlander", "Toyota");
INSERT INTO "car_names" VALUES ("301", "F-150", "Ford");
INSERT INTO "car_names" VALUES ("302", "Escape", "Ford");
INSERT INTO "car_names" VALUES ("303", "Mustang", "Ford");
INSERT INTO "car_names" VALUES ("401", "3 Series", "BMW");
INSERT INTO "car_names" VALUES ("402", "X5", "BMW");
INSERT INTO "car_names" VALUES ("501", "C-Class", "Mercedes-Benz");
INSERT INTO "car_names" VALUES ("502", "E-Class", "Mercedes-Benz");
INSERT INTO "car_names" VALUES ("601", "Altima", "Nissan");
INSERT INTO "car_names" VALUES ("602", "Rogue", "Nissan");
INSERT INTO "car_names" VALUES ("701", "A4", "Audi");
INSERT INTO "car_names" VALUES ("801", "Elantra", "Hyundai");
INSERT INTO "car_names" VALUES ("901", "Sportage", "Kia");
INSERT INTO "car_names" VALUES ("1001", "Jetta", "Volkswagen");
INSERT INTO "car_names" VALUES ("1002", "Golf", "Volkswagen");
INSERT INTO "car_names" VALUES ("1003", "Passat", "Volkswagen");
INSERT INTO "car_names" VALUES ("1004", "Tiguan", "Volkswagen");
INSERT INTO "car_names" VALUES ("1005", "Atlas", "Volkswagen");