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,
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,
"Accelerate" FLOAT,
PRIMARY KEY ("Id"),
FOREIGN KEY ("Id") REFERENCES "car_names"("MakeId")
);

CREATE TABLE "continents" (
"ContId" INT,
"Continent" TEXT,
PRIMARY KEY ("ContId")
);

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

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", "volvo", "Volvo Group");
INSERT INTO "car_makers" VALUES ("2", "ford", "Ford Motor Company");
INSERT INTO "car_makers" VALUES ("3", "honda", "Honda Motor Co.");
INSERT INTO "car_makers" VALUES ("4", "bmw", "Bayerische Motoren Werke AG");
INSERT INTO "car_makers" VALUES ("5", "mercedes", "Mercedes-Benz Group AG");
INSERT INTO "model_list" VALUES ("101", "1", "V70");
INSERT INTO "model_list" VALUES ("102", "1", "S60");
INSERT INTO "model_list" VALUES ("103", "1", "XC90");
INSERT INTO "model_list" VALUES ("104", "1", "C30");
INSERT INTO "model_list" VALUES ("105", "1", "S90");
INSERT INTO "model_list" VALUES ("201", "2", "Focus");
INSERT INTO "model_list" VALUES ("301", "3", "Civic");
INSERT INTO "model_list" VALUES ("401", "4", "3 Series");
INSERT INTO "model_list" VALUES ("501", "5", "C-Class");
INSERT INTO "car_names" VALUES ("1", "V70");
INSERT INTO "car_names" VALUES ("2", "S60");
INSERT INTO "car_names" VALUES ("3", "XC90");
INSERT INTO "car_names" VALUES ("4", "C30");
INSERT INTO "car_names" VALUES ("5", "S90");
INSERT INTO "car_names" VALUES ("6", "V70");
INSERT INTO "car_names" VALUES ("7", "S60");
INSERT INTO "car_names" VALUES ("8", "XC90");
INSERT INTO "car_names" VALUES ("9", "C30");
INSERT INTO "car_names" VALUES ("10", "S90");
INSERT INTO "car_names" VALUES ("11", "V70");
INSERT INTO "car_names" VALUES ("12", "S60");
INSERT INTO "car_names" VALUES ("13", "XC90");
INSERT INTO "car_names" VALUES ("14", "C30");
INSERT INTO "car_names" VALUES ("15", "S90");
INSERT INTO "car_names" VALUES ("16", "V70");
INSERT INTO "car_names" VALUES ("17", "S60");
INSERT INTO "car_names" VALUES ("18", "XC90");
INSERT INTO "car_names" VALUES ("19", "C30");
INSERT INTO "car_names" VALUES ("20", "S90");
INSERT INTO "car_names" VALUES ("21", "Focus");
INSERT INTO "car_names" VALUES ("22", "Civic");
INSERT INTO "car_names" VALUES ("23", "3 Series");
INSERT INTO "car_names" VALUES ("24", "C-Class");
INSERT INTO "cars_data" VALUES ("1", "4", "12.5");
INSERT INTO "cars_data" VALUES ("2", "6", "10.2");
INSERT INTO "cars_data" VALUES ("3", "8", "9.8");
INSERT INTO "cars_data" VALUES ("4", "4", "13.0");
INSERT INTO "cars_data" VALUES ("5", "6", "11.5");
INSERT INTO "cars_data" VALUES ("6", "5", "12.5");
INSERT INTO "cars_data" VALUES ("7", "4", "10.2");
INSERT INTO "cars_data" VALUES ("8", "6", "9.8");
INSERT INTO "cars_data" VALUES ("9", "3", "13.0");
INSERT INTO "cars_data" VALUES ("10", "5", "11.5");
INSERT INTO "cars_data" VALUES ("11", "4", "14.0");
INSERT INTO "cars_data" VALUES ("12", "4", "14.0");
INSERT INTO "cars_data" VALUES ("13", "4", "14.0");
INSERT INTO "cars_data" VALUES ("14", "4", "14.0");
INSERT INTO "cars_data" VALUES ("15", "4", "14.0");
INSERT INTO "cars_data" VALUES ("16", "4", "14.0");
INSERT INTO "cars_data" VALUES ("17", "4", "14.0");
INSERT INTO "cars_data" VALUES ("18", "4", "14.0");
INSERT INTO "cars_data" VALUES ("19", "4", "14.0");
INSERT INTO "cars_data" VALUES ("20", "4", "14.0");
INSERT INTO "cars_data" VALUES ("21", "4", "9.0");
INSERT INTO "cars_data" VALUES ("22", "4", "8.5");
INSERT INTO "cars_data" VALUES ("23", "6", "7.0");
INSERT INTO "cars_data" VALUES ("24", "8", "6.5");
INSERT INTO "continents" VALUES ("1", "Europe");
INSERT INTO "continents" VALUES ("2", "North America");
INSERT INTO "continents" VALUES ("3", "Asia");
INSERT INTO "countries" VALUES ("1", "Sweden");
INSERT INTO "countries" VALUES ("2", "USA");
INSERT INTO "countries" VALUES ("3", "Japan");
INSERT INTO "countries" VALUES ("4", "Germany");