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,
PRIMARY KEY ("MakeId"),
FOREIGN KEY ("Model") REFERENCES "model_list"("Model")
);

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

CREATE TABLE "countries" (
"CountryId" INT,
"CountryName" TEXT,
PRIMARY KEY ("CountryId")
);

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





INSERT INTO "car_makers" VALUES ("1", "Toyota");
INSERT INTO "car_makers" VALUES ("2", "Ford");
INSERT INTO "car_makers" VALUES ("3", "Honda");
INSERT INTO "car_makers" VALUES ("4", "Chevrolet");
INSERT INTO "car_makers" VALUES ("5", "BMW");
INSERT INTO "car_makers" VALUES ("6", "Volkswagen");
INSERT INTO "car_makers" VALUES ("7", "Nissan");
INSERT INTO "car_makers" VALUES ("8", "Mercedes");
INSERT INTO "car_makers" VALUES ("9", "Audi");
INSERT INTO "car_makers" VALUES ("10", "Hyundai");
INSERT INTO "model_list" VALUES ("1", "Corolla");
INSERT INTO "model_list" VALUES ("2", "Mustang");
INSERT INTO "model_list" VALUES ("3", "Civic");
INSERT INTO "model_list" VALUES ("4", "Camaro");
INSERT INTO "model_list" VALUES ("5", "3 Series");
INSERT INTO "model_list" VALUES ("6", "Golf");
INSERT INTO "model_list" VALUES ("7", "Altima");
INSERT INTO "model_list" VALUES ("8", "C-Class");
INSERT INTO "model_list" VALUES ("9", "A4");
INSERT INTO "model_list" VALUES ("10", "Elantra");
INSERT INTO "model_list" VALUES ("11", "Accord");
INSERT INTO "model_list" VALUES ("12", "F-150");
INSERT INTO "model_list" VALUES ("13", "Passat");
INSERT INTO "car_names" VALUES ("1", "Corolla");
INSERT INTO "car_names" VALUES ("2", "Mustang");
INSERT INTO "car_names" VALUES ("3", "Civic");
INSERT INTO "car_names" VALUES ("4", "Camaro");
INSERT INTO "car_names" VALUES ("5", "3 Series");
INSERT INTO "car_names" VALUES ("6", "Golf");
INSERT INTO "car_names" VALUES ("7", "Altima");
INSERT INTO "car_names" VALUES ("8", "C-Class");
INSERT INTO "car_names" VALUES ("9", "A4");
INSERT INTO "car_names" VALUES ("10", "Elantra");
INSERT INTO "car_names" VALUES ("11", "Accord");
INSERT INTO "car_names" VALUES ("12", "F-150");
INSERT INTO "car_names" VALUES ("13", "Passat");
INSERT INTO "cars_data" VALUES ("1", "75", "1980");
INSERT INTO "cars_data" VALUES ("2", "210", "1980");
INSERT INTO "cars_data" VALUES ("3", "70", "1979");
INSERT INTO "cars_data" VALUES ("4", "190", "1980");
INSERT INTO "cars_data" VALUES ("5", "180", "1981");
INSERT INTO "cars_data" VALUES ("6", "90", "1980");
INSERT INTO "cars_data" VALUES ("7", "140", "1982");
INSERT INTO "cars_data" VALUES ("8", "155", "1980");
INSERT INTO "cars_data" VALUES ("9", "170", "1983");
INSERT INTO "cars_data" VALUES ("10", "110", "1980");
INSERT INTO "cars_data" VALUES ("11", "100", "1980");
INSERT INTO "cars_data" VALUES ("12", "200", "1978");
INSERT INTO "cars_data" VALUES ("13", "130", "1980");
INSERT INTO "countries" VALUES ("1", "Japan");
INSERT INTO "countries" VALUES ("2", "USA");
INSERT INTO "countries" VALUES ("3", "Germany");
INSERT INTO "countries" VALUES ("4", "South Korea");
INSERT INTO "countries" VALUES ("5", "France");