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

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

CREATE TABLE "cars_data" (
"Id" INT,
"Cylinders" INT,
"Edispl" FLOAT,
"Horsepower" TEXT,
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", "Ford Motor Company");
INSERT INTO "car_makers" VALUES ("2", "honda", "Honda Motor Co.");
INSERT INTO "car_makers" VALUES ("3", "toyota", "Toyota Motor Corporation");
INSERT INTO "car_makers" VALUES ("4", "chevrolet", "Chevrolet");
INSERT INTO "car_makers" VALUES ("5", "volkswagen", "Volkswagen AG");
INSERT INTO "car_makers" VALUES ("6", "bmw", "Bayerische Motoren Werke AG");
INSERT INTO "car_makers" VALUES ("7", "mercedes", "Mercedes-Benz");
INSERT INTO "car_makers" VALUES ("8", "nissan", "Nissan Motor Corporation");
INSERT INTO "car_makers" VALUES ("9", "audi", "Audi AG");
INSERT INTO "car_makers" VALUES ("10", "subaru", "Subaru Corporation");
INSERT INTO "model_list" VALUES ("1", "Mustang");
INSERT INTO "model_list" VALUES ("2", "Civic");
INSERT INTO "model_list" VALUES ("3", "Camry");
INSERT INTO "model_list" VALUES ("4", "Corvette");
INSERT INTO "model_list" VALUES ("5", "Golf");
INSERT INTO "model_list" VALUES ("6", "3 Series");
INSERT INTO "model_list" VALUES ("7", "C-Class");
INSERT INTO "model_list" VALUES ("8", "Altima");
INSERT INTO "model_list" VALUES ("9", "A4");
INSERT INTO "model_list" VALUES ("10", "Impreza");
INSERT INTO "model_list" VALUES ("11", "Focus");
INSERT INTO "model_list" VALUES ("12", "Accord");
INSERT INTO "model_list" VALUES ("13", "Prius");
INSERT INTO "model_list" VALUES ("14", "Malibu");
INSERT INTO "model_list" VALUES ("15", "Jetta");
INSERT INTO "model_list" VALUES ("16", "X5");
INSERT INTO "model_list" VALUES ("17", "E-Class");
INSERT INTO "model_list" VALUES ("18", "Titan");
INSERT INTO "model_list" VALUES ("19", "Q5");
INSERT INTO "model_list" VALUES ("20", "Forester");
INSERT INTO "model_list" VALUES ("21", "Fiesta");
INSERT INTO "model_list" VALUES ("22", "CR-V");
INSERT INTO "model_list" VALUES ("23", "RAV4");
INSERT INTO "model_list" VALUES ("24", "Silverado");
INSERT INTO "model_list" VALUES ("25", "Passat");
INSERT INTO "model_list" VALUES ("26", "5 Series");
INSERT INTO "model_list" VALUES ("27", "GLC");
INSERT INTO "model_list" VALUES ("28", "Rogue");
INSERT INTO "model_list" VALUES ("29", "A6");
INSERT INTO "model_list" VALUES ("30", "Outback");
INSERT INTO "car_names" VALUES ("1", "Mustang");
INSERT INTO "car_names" VALUES ("2", "Civic");
INSERT INTO "car_names" VALUES ("3", "Camry");
INSERT INTO "car_names" VALUES ("4", "Corvette");
INSERT INTO "car_names" VALUES ("5", "Golf");
INSERT INTO "car_names" VALUES ("6", "3 Series");
INSERT INTO "car_names" VALUES ("7", "C-Class");
INSERT INTO "car_names" VALUES ("8", "Altima");
INSERT INTO "car_names" VALUES ("9", "A4");
INSERT INTO "car_names" VALUES ("10", "Impreza");
INSERT INTO "car_names" VALUES ("11", "Focus");
INSERT INTO "car_names" VALUES ("12", "Accord");
INSERT INTO "car_names" VALUES ("13", "Prius");
INSERT INTO "car_names" VALUES ("14", "Malibu");
INSERT INTO "car_names" VALUES ("15", "Jetta");
INSERT INTO "car_names" VALUES ("16", "X5");
INSERT INTO "car_names" VALUES ("17", "E-Class");
INSERT INTO "car_names" VALUES ("18", "Titan");
INSERT INTO "car_names" VALUES ("19", "Q5");
INSERT INTO "car_names" VALUES ("20", "Forester");
INSERT INTO "car_names" VALUES ("21", "Fiesta");
INSERT INTO "car_names" VALUES ("22", "CR-V");
INSERT INTO "car_names" VALUES ("23", "RAV4");
INSERT INTO "car_names" VALUES ("24", "Silverado");
INSERT INTO "car_names" VALUES ("25", "Passat");
INSERT INTO "car_names" VALUES ("26", "5 Series");
INSERT INTO "car_names" VALUES ("27", "GLC");
INSERT INTO "car_names" VALUES ("28", "Rogue");
INSERT INTO "car_names" VALUES ("29", "A6");
INSERT INTO "car_names" VALUES ("30", "Outback");
INSERT INTO "cars_data" VALUES ("1", "8", "302.0", "450");
INSERT INTO "cars_data" VALUES ("2", "4", "1.5", "174");
INSERT INTO "cars_data" VALUES ("3", "4", "2.5", "203");
INSERT INTO "cars_data" VALUES ("4", "8", "6.2", "490");
INSERT INTO "cars_data" VALUES ("5", "4", "1.4", "147");
INSERT INTO "cars_data" VALUES ("6", "6", "3.0", "382");
INSERT INTO "cars_data" VALUES ("7", "4", "2.0", "255");
INSERT INTO "cars_data" VALUES ("8", "4", "2.5", "188");
INSERT INTO "cars_data" VALUES ("9", "4", "2.0", "201");
INSERT INTO "cars_data" VALUES ("10", "4", "2.5", "182");
INSERT INTO "cars_data" VALUES ("11", "4", "2.0", "160");
INSERT INTO "cars_data" VALUES ("12", "4", "2.0", "192");
INSERT INTO "cars_data" VALUES ("13", "4", "1.8", "121");
INSERT INTO "cars_data" VALUES ("14", "4", "1.5", "160");
INSERT INTO "cars_data" VALUES ("15", "4", "1.4", "150");
INSERT INTO "cars_data" VALUES ("16", "6", "3.0", "335");
INSERT INTO "cars_data" VALUES ("17", "4", "2.0", "255");
INSERT INTO "cars_data" VALUES ("18", "8", "5.6", "400");
INSERT INTO "cars_data" VALUES ("19", "4", "2.0", "201");
INSERT INTO "cars_data" VALUES ("20", "4", "2.5", "182");
INSERT INTO "cars_data" VALUES ("21", "3", "1.0", "123");
INSERT INTO "cars_data" VALUES ("22", "4", "1.5", "190");
INSERT INTO "cars_data" VALUES ("23", "4", "2.5", "203");
INSERT INTO "cars_data" VALUES ("24", "8", "5.3", "355");
INSERT INTO "cars_data" VALUES ("25", "4", "2.0", "174");
INSERT INTO "cars_data" VALUES ("26", "6", "3.0", "335");
INSERT INTO "cars_data" VALUES ("27", "4", "2.0", "255");
INSERT INTO "cars_data" VALUES ("28", "4", "2.5", "181");
INSERT INTO "cars_data" VALUES ("29", "6", "3.0", "335");
INSERT INTO "cars_data" VALUES ("30", "4", "2.5", "182");