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

CREATE TABLE "car_names" (
"MakeId" INT,
"Model" 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", "Toyota Motor Corporation", "Japan");
INSERT INTO "car_makers" VALUES ("2", "Honda", "Honda Motor Co., Ltd.", "Japan");
INSERT INTO "car_makers" VALUES ("3", "Ford", "Ford Motor Company", "USA");
INSERT INTO "car_makers" VALUES ("4", "BMW", "Bayerische Motoren Werke AG", "Germany");
INSERT INTO "car_makers" VALUES ("5", "Mercedes-Benz", "Mercedes-Benz Group AG", "Germany");
INSERT INTO "car_makers" VALUES ("6", "Tesla", "Tesla, Inc.", "USA");
INSERT INTO "car_makers" VALUES ("7", "Volkswagen", "Volkswagen AG", "Germany");
INSERT INTO "car_makers" VALUES ("8", "Hyundai", "Hyundai Motor Company", "South Korea");
INSERT INTO "car_makers" VALUES ("9", "Nissan", "Nissan Motor Corporation", "Japan");
INSERT INTO "car_makers" VALUES ("10", "Audi", "Audi AG", "Germany");
INSERT INTO "model_list" VALUES ("101", "1", "Camry");
INSERT INTO "model_list" VALUES ("102", "1", "Corolla");
INSERT INTO "model_list" VALUES ("103", "2", "Civic");
INSERT INTO "model_list" VALUES ("104", "2", "CR-V");
INSERT INTO "model_list" VALUES ("105", "3", "F-150");
INSERT INTO "model_list" VALUES ("106", "3", "Mustang");
INSERT INTO "model_list" VALUES ("107", "4", "3 Series");
INSERT INTO "model_list" VALUES ("108", "4", "X5");
INSERT INTO "model_list" VALUES ("109", "5", "C-Class");
INSERT INTO "model_list" VALUES ("110", "5", "E-Class");
INSERT INTO "model_list" VALUES ("111", "6", "Model 3");
INSERT INTO "model_list" VALUES ("112", "6", "Model S");
INSERT INTO "model_list" VALUES ("113", "7", "Golf");
INSERT INTO "model_list" VALUES ("114", "7", "Passat");
INSERT INTO "model_list" VALUES ("115", "8", "Elantra");
INSERT INTO "model_list" VALUES ("116", "8", "Tucson");
INSERT INTO "model_list" VALUES ("117", "9", "Altima");
INSERT INTO "model_list" VALUES ("118", "9", "Rogue");
INSERT INTO "model_list" VALUES ("119", "10", "A4");
INSERT INTO "model_list" VALUES ("120", "10", "Q5");
INSERT INTO "model_list" VALUES ("121", "1", "RAV4");
INSERT INTO "model_list" VALUES ("122", "2", "Accord");
INSERT INTO "model_list" VALUES ("123", "3", "Explorer");
INSERT INTO "model_list" VALUES ("124", "4", "5 Series");
INSERT INTO "model_list" VALUES ("125", "5", "GLC");
INSERT INTO "model_list" VALUES ("126", "6", "Model Y");
INSERT INTO "model_list" VALUES ("127", "7", "Jetta");
INSERT INTO "model_list" VALUES ("128", "8", "Sonata");
INSERT INTO "model_list" VALUES ("129", "9", "Titan");
INSERT INTO "model_list" VALUES ("130", "10", "A6");
INSERT INTO "car_names" VALUES ("101", "Camry");
INSERT INTO "car_names" VALUES ("102", "Corolla");
INSERT INTO "car_names" VALUES ("103", "Civic");
INSERT INTO "car_names" VALUES ("104", "CR-V");
INSERT INTO "car_names" VALUES ("105", "F-150");
INSERT INTO "car_names" VALUES ("106", "Mustang");
INSERT INTO "car_names" VALUES ("107", "3 Series");
INSERT INTO "car_names" VALUES ("108", "X5");
INSERT INTO "car_names" VALUES ("109", "C-Class");
INSERT INTO "car_names" VALUES ("110", "E-Class");
INSERT INTO "car_names" VALUES ("111", "Model 3");
INSERT INTO "car_names" VALUES ("112", "Model S");
INSERT INTO "car_names" VALUES ("113", "Golf");
INSERT INTO "car_names" VALUES ("114", "Passat");
INSERT INTO "car_names" VALUES ("115", "Elantra");
INSERT INTO "car_names" VALUES ("116", "Tucson");
INSERT INTO "car_names" VALUES ("117", "Altima");
INSERT INTO "car_names" VALUES ("118", "Rogue");
INSERT INTO "car_names" VALUES ("119", "A4");
INSERT INTO "car_names" VALUES ("120", "Q5");
INSERT INTO "car_names" VALUES ("121", "RAV4");
INSERT INTO "car_names" VALUES ("122", "Accord");
INSERT INTO "car_names" VALUES ("123", "Explorer");
INSERT INTO "car_names" VALUES ("124", "5 Series");
INSERT INTO "car_names" VALUES ("125", "GLC");
INSERT INTO "car_names" VALUES ("126", "Model Y");
INSERT INTO "car_names" VALUES ("127", "Jetta");
INSERT INTO "car_names" VALUES ("128", "Sonata");
INSERT INTO "car_names" VALUES ("129", "Titan");
INSERT INTO "car_names" VALUES ("130", "A6");