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,
"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", "Toyota Motor Corporation");
INSERT INTO "car_makers" VALUES ("2", "Honda Motor Co.");
INSERT INTO "car_makers" VALUES ("3", "Ford Motor Company");
INSERT INTO "car_makers" VALUES ("4", "General Motors");
INSERT INTO "car_makers" VALUES ("5", "Volkswagen AG");
INSERT INTO "car_makers" VALUES ("6", "BMW AG");
INSERT INTO "car_makers" VALUES ("7", "Mercedes-Benz Group AG");
INSERT INTO "car_makers" VALUES ("8", "Hyundai Motor Company");
INSERT INTO "car_makers" VALUES ("9", "Nissan Motor Corporation");
INSERT INTO "car_makers" VALUES ("10", "Tesla, Inc.");
INSERT INTO "model_list" VALUES ("101", "1", "Camry");
INSERT INTO "model_list" VALUES ("102", "1", "Corolla");
INSERT INTO "model_list" VALUES ("103", "1", "RAV4");
INSERT INTO "model_list" VALUES ("104", "1", "Highlander");
INSERT INTO "model_list" VALUES ("105", "1", "Tacoma");
INSERT INTO "model_list" VALUES ("201", "2", "Civic");
INSERT INTO "model_list" VALUES ("202", "2", "CR-V");
INSERT INTO "model_list" VALUES ("203", "2", "Accord");
INSERT INTO "model_list" VALUES ("301", "3", "F-150");
INSERT INTO "model_list" VALUES ("302", "3", "Explorer");
INSERT INTO "model_list" VALUES ("303", "3", "Mustang");
INSERT INTO "model_list" VALUES ("401", "4", "Silverado");
INSERT INTO "model_list" VALUES ("402", "4", "Equinox");
INSERT INTO "model_list" VALUES ("501", "5", "Golf");
INSERT INTO "model_list" VALUES ("502", "5", "Jetta");
INSERT INTO "model_list" VALUES ("601", "6", "3 Series");
INSERT INTO "model_list" VALUES ("602", "6", "X5");
INSERT INTO "model_list" VALUES ("701", "7", "C-Class");
INSERT INTO "model_list" VALUES ("801", "8", "Elantra");
INSERT INTO "model_list" VALUES ("901", "9", "Altima");
INSERT INTO "model_list" VALUES ("1001", "10", "Model 3");
INSERT INTO "model_list" VALUES ("1002", "10", "Model Y");
INSERT INTO "model_list" VALUES ("1003", "10", "Model S");
INSERT INTO "model_list" VALUES ("1004", "10", "Model X");
INSERT INTO "model_list" VALUES ("1005", "1", "Sienna");
INSERT INTO "model_list" VALUES ("1006", "2", "Pilot");
INSERT INTO "model_list" VALUES ("1007", "3", "Escape");
INSERT INTO "model_list" VALUES ("1008", "4", "Tahoe");
INSERT INTO "model_list" VALUES ("1009", "5", "Passat");
INSERT INTO "model_list" VALUES ("1010", "6", "5 Series");
INSERT INTO "model_list" VALUES ("1011", "7", "E-Class");
INSERT INTO "model_list" VALUES ("1012", "8", "Sonata");
INSERT INTO "model_list" VALUES ("1013", "9", "Rogue");
INSERT INTO "car_names" VALUES ("101", "Camry", "Toyota");
INSERT INTO "car_names" VALUES ("102", "Corolla", "Toyota");
INSERT INTO "car_names" VALUES ("103", "RAV4", "Toyota");
INSERT INTO "car_names" VALUES ("104", "Highlander", "Toyota");
INSERT INTO "car_names" VALUES ("105", "Tacoma", "Toyota");
INSERT INTO "car_names" VALUES ("201", "Civic", "Honda");
INSERT INTO "car_names" VALUES ("202", "CR-V", "Honda");
INSERT INTO "car_names" VALUES ("203", "Accord", "Honda");
INSERT INTO "car_names" VALUES ("301", "F-150", "Ford");
INSERT INTO "car_names" VALUES ("302", "Explorer", "Ford");
INSERT INTO "car_names" VALUES ("303", "Mustang", "Ford");
INSERT INTO "car_names" VALUES ("401", "Silverado", "Chevrolet");
INSERT INTO "car_names" VALUES ("402", "Equinox", "Chevrolet");
INSERT INTO "car_names" VALUES ("501", "Golf", "Volkswagen");
INSERT INTO "car_names" VALUES ("502", "Jetta", "Volkswagen");
INSERT INTO "car_names" VALUES ("601", "3 Series", "BMW");
INSERT INTO "car_names" VALUES ("602", "X5", "BMW");
INSERT INTO "car_names" VALUES ("701", "C-Class", "Mercedes-Benz");
INSERT INTO "car_names" VALUES ("801", "Elantra", "Hyundai");
INSERT INTO "car_names" VALUES ("901", "Altima", "Nissan");
INSERT INTO "car_names" VALUES ("1001", "Model 3", "Tesla");
INSERT INTO "car_names" VALUES ("1002", "Model Y", "Tesla");
INSERT INTO "car_names" VALUES ("1003", "Model S", "Tesla");
INSERT INTO "car_names" VALUES ("1004", "Model X", "Tesla");
INSERT INTO "car_names" VALUES ("1005", "Sienna", "Toyota");
INSERT INTO "car_names" VALUES ("1006", "Pilot", "Honda");
INSERT INTO "car_names" VALUES ("1007", "Escape", "Ford");
INSERT INTO "car_names" VALUES ("1008", "Tahoe", "Chevrolet");
INSERT INTO "car_names" VALUES ("1009", "Passat", "Volkswagen");
INSERT INTO "car_names" VALUES ("1010", "5 Series", "BMW");
INSERT INTO "car_names" VALUES ("1011", "E-Class", "Mercedes-Benz");
INSERT INTO "car_names" VALUES ("1012", "Sonata", "Hyundai");
INSERT INTO "car_names" VALUES ("1013", "Rogue", "Nissan");