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", "Honda", "Honda Motor Company");
INSERT INTO "car_makers" VALUES ("2", "Toyota", "Toyota Motor Corporation");
INSERT INTO "car_makers" VALUES ("3", "Ford", "Ford Motor Company");
INSERT INTO "car_makers" VALUES ("4", "Chevrolet", "General Motors");
INSERT INTO "car_makers" VALUES ("5", "BMW", "Bayerische Motoren Werke AG");
INSERT INTO "car_makers" VALUES ("6", "Mercedes-Benz", "Daimler AG");
INSERT INTO "car_makers" VALUES ("7", "Nissan", "Nissan Motor Corporation");
INSERT INTO "car_makers" VALUES ("8", "Audi", "Audi AG");
INSERT INTO "car_makers" VALUES ("9", "Hyundai", "Hyundai Motor Company");
INSERT INTO "car_makers" VALUES ("10", "Kia", "Kia Motors Corporation");
INSERT INTO "model_list" VALUES ("1", "Civic");
INSERT INTO "model_list" VALUES ("2", "Corolla");
INSERT INTO "model_list" VALUES ("3", "F-150");
INSERT INTO "model_list" VALUES ("4", "Silverado");
INSERT INTO "model_list" VALUES ("5", "3 Series");
INSERT INTO "model_list" VALUES ("6", "C-Class");
INSERT INTO "model_list" VALUES ("7", "Altima");
INSERT INTO "model_list" VALUES ("8", "A4");
INSERT INTO "model_list" VALUES ("9", "Elantra");
INSERT INTO "model_list" VALUES ("10", "Sportage");
INSERT INTO "model_list" VALUES ("11", "Accord");
INSERT INTO "model_list" VALUES ("12", "Camry");
INSERT INTO "model_list" VALUES ("13", "Mustang");
INSERT INTO "model_list" VALUES ("14", "Malibu");
INSERT INTO "model_list" VALUES ("15", "X5");
INSERT INTO "model_list" VALUES ("16", "E-Class");
INSERT INTO "model_list" VALUES ("17", "Titan");
INSERT INTO "model_list" VALUES ("18", "Q5");
INSERT INTO "model_list" VALUES ("19", "Sonata");
INSERT INTO "model_list" VALUES ("20", "Sorento");
INSERT INTO "car_names" VALUES ("1", "Civic");
INSERT INTO "car_names" VALUES ("2", "Corolla");
INSERT INTO "car_names" VALUES ("3", "F-150");
INSERT INTO "car_names" VALUES ("4", "Silverado");
INSERT INTO "car_names" VALUES ("5", "3 Series");
INSERT INTO "car_names" VALUES ("6", "C-Class");
INSERT INTO "car_names" VALUES ("7", "Altima");
INSERT INTO "car_names" VALUES ("8", "A4");
INSERT INTO "car_names" VALUES ("9", "Elantra");
INSERT INTO "car_names" VALUES ("10", "Sportage");
INSERT INTO "car_names" VALUES ("11", "Accord");
INSERT INTO "car_names" VALUES ("12", "Camry");
INSERT INTO "car_names" VALUES ("13", "Mustang");
INSERT INTO "car_names" VALUES ("14", "Malibu");
INSERT INTO "car_names" VALUES ("15", "X5");
INSERT INTO "car_names" VALUES ("16", "E-Class");
INSERT INTO "car_names" VALUES ("17", "Titan");
INSERT INTO "car_names" VALUES ("18", "Q5");
INSERT INTO "car_names" VALUES ("19", "Sonata");
INSERT INTO "car_names" VALUES ("20", "Sorento");
INSERT INTO "cars_data" VALUES ("1", "4", "1.8", "140");
INSERT INTO "cars_data" VALUES ("2", "4", "1.8", "132");
INSERT INTO "cars_data" VALUES ("3", "6", "3.5", "282");
INSERT INTO "cars_data" VALUES ("4", "8", "5.3", "355");
INSERT INTO "cars_data" VALUES ("5", "4", "2.0", "255");
INSERT INTO "cars_data" VALUES ("6", "4", "2.0", "255");
INSERT INTO "cars_data" VALUES ("7", "4", "2.5", "188");
INSERT INTO "cars_data" VALUES ("8", "4", "2.0", "201");
INSERT INTO "cars_data" VALUES ("9", "4", "2.0", "147");
INSERT INTO "cars_data" VALUES ("10", "4", "2.4", "181");
INSERT INTO "cars_data" VALUES ("11", "4", "2.0", "192");
INSERT INTO "cars_data" VALUES ("12", "4", "2.5", "203");
INSERT INTO "cars_data" VALUES ("13", "4", "2.3", "310");
INSERT INTO "cars_data" VALUES ("14", "4", "1.5", "160");
INSERT INTO "cars_data" VALUES ("15", "6", "3.0", "335");
INSERT INTO "cars_data" VALUES ("16", "4", "2.0", "255");
INSERT INTO "cars_data" VALUES ("17", "8", "5.6", "400");
INSERT INTO "cars_data" VALUES ("18", "4", "2.0", "201");
INSERT INTO "cars_data" VALUES ("19", "4", "2.5", "191");
INSERT INTO "cars_data" VALUES ("20", "4", "2.5", "191");
INSERT INTO "cars_data" VALUES ("21", "4", "2.0", "200");
INSERT INTO "cars_data" VALUES ("22", "4", "2.0", "220");
INSERT INTO "cars_data" VALUES ("23", "4", "2.0", "240");
INSERT INTO "cars_data" VALUES ("24", "4", "2.0", "260");
INSERT INTO "cars_data" VALUES ("25", "4", "2.0", "280");
INSERT INTO "cars_data" VALUES ("26", "4", "2.0", "300");
INSERT INTO "cars_data" VALUES ("27", "4", "2.0", "320");
INSERT INTO "cars_data" VALUES ("28", "4", "2.0", "340");
INSERT INTO "cars_data" VALUES ("29", "4", "2.0", "360");
INSERT INTO "cars_data" VALUES ("30", "4", "2.0", "380");