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

CREATE TABLE "car_names" (
"MakeId" INT UNIQUE,
"Model" TEXT,
"Make" TEXT,
PRIMARY KEY ("MakeId"),
FOREIGN KEY ("Model") REFERENCES "model_list"("Model")
);

CREATE TABLE "cars_data" (
"Id" INT,
"MPG" TEXT,
"Year" INT,
PRIMARY KEY ("Id"),
FOREIGN KEY ("Id") REFERENCES "car_names"("MakeId")
);

CREATE TABLE "model_list" (
"ModelId" INT,
"Model" TEXT UNIQUE,
PRIMARY KEY ("ModelId")
);





INSERT INTO "car_makers" VALUES ("1", "Ford");
INSERT INTO "car_makers" VALUES ("2", "Chevrolet");
INSERT INTO "car_makers" VALUES ("3", "Honda");
INSERT INTO "car_makers" VALUES ("4", "Toyota");
INSERT INTO "car_makers" VALUES ("5", "BMW");
INSERT INTO "car_makers" VALUES ("6", "Mercedes-Benz");
INSERT INTO "car_makers" VALUES ("7", "Audi");
INSERT INTO "car_makers" VALUES ("8", "Nissan");
INSERT INTO "car_makers" VALUES ("9", "Volkswagen");
INSERT INTO "car_makers" VALUES ("10", "Hyundai");
INSERT INTO "model_list" VALUES ("1", "F-150");
INSERT INTO "model_list" VALUES ("2", "Silverado");
INSERT INTO "model_list" VALUES ("3", "Civic");
INSERT INTO "model_list" VALUES ("4", "Corolla");
INSERT INTO "model_list" VALUES ("5", "3 Series");
INSERT INTO "model_list" VALUES ("6", "C-Class");
INSERT INTO "model_list" VALUES ("7", "A4");
INSERT INTO "model_list" VALUES ("8", "Altima");
INSERT INTO "model_list" VALUES ("9", "Golf");
INSERT INTO "model_list" VALUES ("10", "Elantra");
INSERT INTO "model_list" VALUES ("11", "Mustang");
INSERT INTO "model_list" VALUES ("12", "Camaro");
INSERT INTO "model_list" VALUES ("13", "Accord");
INSERT INTO "model_list" VALUES ("14", "Camry");
INSERT INTO "model_list" VALUES ("15", "5 Series");
INSERT INTO "model_list" VALUES ("16", "E-Class");
INSERT INTO "model_list" VALUES ("17", "A6");
INSERT INTO "model_list" VALUES ("18", "Titan");
INSERT INTO "model_list" VALUES ("19", "Passat");
INSERT INTO "model_list" VALUES ("20", "Sonata");
INSERT INTO "model_list" VALUES ("21", "Explorer");
INSERT INTO "model_list" VALUES ("22", "Tahoe");
INSERT INTO "model_list" VALUES ("23", "CR-V");
INSERT INTO "model_list" VALUES ("24", "RAV4");
INSERT INTO "model_list" VALUES ("25", "X5");
INSERT INTO "model_list" VALUES ("26", "GLC");
INSERT INTO "model_list" VALUES ("27", "Q5");
INSERT INTO "model_list" VALUES ("28", "Rogue");
INSERT INTO "model_list" VALUES ("29", "Jetta");
INSERT INTO "model_list" VALUES ("30", "Tucson");
INSERT INTO "car_names" VALUES ("1", "F-150", "Ford");
INSERT INTO "car_names" VALUES ("2", "Silverado", "Chevrolet");
INSERT INTO "car_names" VALUES ("3", "Civic", "Honda");
INSERT INTO "car_names" VALUES ("4", "Corolla", "Toyota");
INSERT INTO "car_names" VALUES ("5", "3 Series", "BMW");
INSERT INTO "car_names" VALUES ("6", "C-Class", "Mercedes-Benz");
INSERT INTO "car_names" VALUES ("7", "A4", "Audi");
INSERT INTO "car_names" VALUES ("8", "Altima", "Nissan");
INSERT INTO "car_names" VALUES ("9", "Golf", "Volkswagen");
INSERT INTO "car_names" VALUES ("10", "Elantra", "Hyundai");
INSERT INTO "car_names" VALUES ("11", "Mustang", "Ford");
INSERT INTO "car_names" VALUES ("12", "Camaro", "Chevrolet");
INSERT INTO "car_names" VALUES ("13", "Accord", "Honda");
INSERT INTO "car_names" VALUES ("14", "Camry", "Toyota");
INSERT INTO "car_names" VALUES ("15", "5 Series", "BMW");
INSERT INTO "car_names" VALUES ("16", "E-Class", "Mercedes-Benz");
INSERT INTO "car_names" VALUES ("17", "A6", "Audi");
INSERT INTO "car_names" VALUES ("18", "Titan", "Nissan");
INSERT INTO "car_names" VALUES ("19", "Passat", "Volkswagen");
INSERT INTO "car_names" VALUES ("20", "Sonata", "Hyundai");
INSERT INTO "car_names" VALUES ("21", "Explorer", "Ford");
INSERT INTO "car_names" VALUES ("22", "Tahoe", "Chevrolet");
INSERT INTO "car_names" VALUES ("23", "CR-V", "Honda");
INSERT INTO "car_names" VALUES ("24", "RAV4", "Toyota");
INSERT INTO "car_names" VALUES ("25", "X5", "BMW");
INSERT INTO "car_names" VALUES ("26", "GLC", "Mercedes-Benz");
INSERT INTO "car_names" VALUES ("27", "Q5", "Audi");
INSERT INTO "car_names" VALUES ("28", "Rogue", "Nissan");
INSERT INTO "car_names" VALUES ("29", "Jetta", "Volkswagen");
INSERT INTO "car_names" VALUES ("30", "Tucson", "Hyundai");
INSERT INTO "cars_data" VALUES ("1", "18", "1979");
INSERT INTO "cars_data" VALUES ("2", "15", "1980");
INSERT INTO "cars_data" VALUES ("3", "30", "1981");
INSERT INTO "cars_data" VALUES ("4", "28", "1982");
INSERT INTO "cars_data" VALUES ("5", "22", "1983");
INSERT INTO "cars_data" VALUES ("6", "20", "1984");
INSERT INTO "cars_data" VALUES ("7", "25", "1985");
INSERT INTO "cars_data" VALUES ("8", "24", "1986");
INSERT INTO "cars_data" VALUES ("9", "32", "1987");
INSERT INTO "cars_data" VALUES ("10", "29", "1988");
INSERT INTO "cars_data" VALUES ("11", "17", "1989");
INSERT INTO "cars_data" VALUES ("12", "16", "1990");
INSERT INTO "cars_data" VALUES ("13", "31", "1991");
INSERT INTO "cars_data" VALUES ("14", "27", "1992");
INSERT INTO "cars_data" VALUES ("15", "23", "1993");
INSERT INTO "cars_data" VALUES ("16", "21", "1994");
INSERT INTO "cars_data" VALUES ("17", "26", "1995");
INSERT INTO "cars_data" VALUES ("18", "14", "1996");
INSERT INTO "cars_data" VALUES ("19", "33", "1997");
INSERT INTO "cars_data" VALUES ("20", "30", "1998");
INSERT INTO "cars_data" VALUES ("21", "19", "1999");
INSERT INTO "cars_data" VALUES ("22", "17", "2000");
INSERT INTO "cars_data" VALUES ("23", "30", "2001");
INSERT INTO "cars_data" VALUES ("24", "28", "2002");
INSERT INTO "cars_data" VALUES ("25", "22", "2003");
INSERT INTO "cars_data" VALUES ("26", "20", "2004");
INSERT INTO "cars_data" VALUES ("27", "25", "2005");
INSERT INTO "cars_data" VALUES ("28", "24", "2006");
INSERT INTO "cars_data" VALUES ("29", "32", "2007");
INSERT INTO "cars_data" VALUES ("30", "29", "2008");