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", "2", "Civic");
INSERT INTO "model_list" VALUES ("106", "2", "CR-V");
INSERT INTO "model_list" VALUES ("107", "2", "Accord");
INSERT INTO "model_list" VALUES ("108", "3", "F-150");
INSERT INTO "model_list" VALUES ("109", "3", "Explorer");
INSERT INTO "model_list" VALUES ("110", "3", "Mustang");
INSERT INTO "model_list" VALUES ("111", "4", "Silverado");
INSERT INTO "model_list" VALUES ("112", "4", "Equinox");
INSERT INTO "model_list" VALUES ("113", "5", "Jetta");
INSERT INTO "model_list" VALUES ("114", "5", "Golf");
INSERT INTO "model_list" VALUES ("115", "6", "3 Series");
INSERT INTO "model_list" VALUES ("116", "6", "X5");
INSERT INTO "model_list" VALUES ("117", "7", "C-Class");
INSERT INTO "model_list" VALUES ("118", "8", "Elantra");
INSERT INTO "model_list" VALUES ("119", "9", "Altima");
INSERT INTO "model_list" VALUES ("120", "10", "Model 3");
INSERT INTO "model_list" VALUES ("121", "10", "Model Y");
INSERT INTO "model_list" VALUES ("122", "1", "Sienna");
INSERT INTO "model_list" VALUES ("123", "2", "Pilot");
INSERT INTO "model_list" VALUES ("124", "3", "Escape");
INSERT INTO "model_list" VALUES ("125", "4", "Tahoe");
INSERT INTO "model_list" VALUES ("126", "5", "Passat");
INSERT INTO "model_list" VALUES ("127", "6", "5 Series");
INSERT INTO "model_list" VALUES ("128", "7", "E-Class");
INSERT INTO "model_list" VALUES ("129", "8", "Sonata");
INSERT INTO "model_list" VALUES ("130", "9", "Rogue");
INSERT INTO "model_list" VALUES ("131", "10", "Model S");
INSERT INTO "model_list" VALUES ("132", "10", "Model X");
INSERT INTO "model_list" VALUES ("133", "1", "Tacoma");
INSERT INTO "model_list" VALUES ("134", "2", "Odyssey");
INSERT INTO "model_list" VALUES ("135", "3", "Bronco");
INSERT INTO "model_list" VALUES ("136", "4", "Colorado");
INSERT INTO "model_list" VALUES ("137", "5", "Tiguan");
INSERT INTO "model_list" VALUES ("138", "6", "X3");
INSERT INTO "model_list" VALUES ("139", "7", "GLC");
INSERT INTO "model_list" VALUES ("140", "8", "Tucson");
INSERT INTO "model_list" VALUES ("141", "9", "Titan");
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", "Civic", "Honda");
INSERT INTO "car_names" VALUES ("106", "CR-V", "Honda");
INSERT INTO "car_names" VALUES ("107", "Accord", "Honda");
INSERT INTO "car_names" VALUES ("108", "F-150", "Ford");
INSERT INTO "car_names" VALUES ("109", "Explorer", "Ford");
INSERT INTO "car_names" VALUES ("110", "Mustang", "Ford");
INSERT INTO "car_names" VALUES ("111", "Silverado", "Chevrolet");
INSERT INTO "car_names" VALUES ("112", "Equinox", "Chevrolet");
INSERT INTO "car_names" VALUES ("113", "Jetta", "Volkswagen");
INSERT INTO "car_names" VALUES ("114", "Golf", "Volkswagen");
INSERT INTO "car_names" VALUES ("115", "3 Series", "BMW");
INSERT INTO "car_names" VALUES ("116", "X5", "BMW");
INSERT INTO "car_names" VALUES ("117", "C-Class", "Mercedes-Benz");
INSERT INTO "car_names" VALUES ("118", "Elantra", "Hyundai");
INSERT INTO "car_names" VALUES ("119", "Altima", "Nissan");
INSERT INTO "car_names" VALUES ("120", "Model 3", "Tesla");
INSERT INTO "car_names" VALUES ("121", "Model Y", "Tesla");
INSERT INTO "car_names" VALUES ("122", "Sienna", "Toyota");
INSERT INTO "car_names" VALUES ("123", "Pilot", "Honda");
INSERT INTO "car_names" VALUES ("124", "Escape", "Ford");
INSERT INTO "car_names" VALUES ("125", "Tahoe", "Chevrolet");
INSERT INTO "car_names" VALUES ("126", "Passat", "Volkswagen");
INSERT INTO "car_names" VALUES ("127", "5 Series", "BMW");
INSERT INTO "car_names" VALUES ("128", "E-Class", "Mercedes-Benz");
INSERT INTO "car_names" VALUES ("129", "Sonata", "Hyundai");
INSERT INTO "car_names" VALUES ("130", "Rogue", "Nissan");
INSERT INTO "car_names" VALUES ("131", "Model S", "Tesla");
INSERT INTO "car_names" VALUES ("132", "Model X", "Tesla");
INSERT INTO "car_names" VALUES ("133", "Tacoma", "Toyota");
INSERT INTO "car_names" VALUES ("134", "Odyssey", "Honda");
INSERT INTO "car_names" VALUES ("135", "Bronco", "Ford");
INSERT INTO "car_names" VALUES ("136", "Colorado", "Chevrolet");
INSERT INTO "car_names" VALUES ("137", "Tiguan", "Volkswagen");
INSERT INTO "car_names" VALUES ("138", "X3", "BMW");
INSERT INTO "car_names" VALUES ("139", "GLC", "Mercedes-Benz");
INSERT INTO "car_names" VALUES ("140", "Tucson", "Hyundai");
INSERT INTO "car_names" VALUES ("141", "Titan", "Nissan");