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,
"FullName" TEXT,
"Country" TEXT,
PRIMARY KEY ("Id"),
FOREIGN KEY ("Country") REFERENCES "countries"("CountryId")
);

CREATE TABLE "car_names" (
"MakeId" INT,
"Make" TEXT,
PRIMARY KEY ("MakeId")
);

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

CREATE TABLE "countries" (
"CountryId" INT UNIQUE,
"CountryName" TEXT,
"Continent" INT,
PRIMARY KEY ("CountryId"),
FOREIGN KEY ("Continent") REFERENCES "continents"("ContId")
);

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





INSERT INTO "continents" VALUES ("1", "Europe");
INSERT INTO "continents" VALUES ("2", "Asia");
INSERT INTO "continents" VALUES ("3", "North America");
INSERT INTO "continents" VALUES ("4", "South America");
INSERT INTO "continents" VALUES ("5", "Africa");
INSERT INTO "continents" VALUES ("6", "Oceania");
INSERT INTO "countries" VALUES ("1", "Germany", "1");
INSERT INTO "countries" VALUES ("2", "France", "1");
INSERT INTO "countries" VALUES ("3", "Italy", "1");
INSERT INTO "countries" VALUES ("4", "Japan", "2");
INSERT INTO "countries" VALUES ("5", "USA", "3");
INSERT INTO "countries" VALUES ("6", "UK", "1");
INSERT INTO "countries" VALUES ("7", "Sweden", "1");
INSERT INTO "countries" VALUES ("8", "South Korea", "2");
INSERT INTO "countries" VALUES ("9", "China", "2");
INSERT INTO "countries" VALUES ("10", "India", "2");
INSERT INTO "car_makers" VALUES ("1", "Volkswagen", "1");
INSERT INTO "car_makers" VALUES ("2", "BMW", "1");
INSERT INTO "car_makers" VALUES ("3", "Mercedes-Benz", "1");
INSERT INTO "car_makers" VALUES ("4", "Audi", "1");
INSERT INTO "car_makers" VALUES ("5", "Renault", "2");
INSERT INTO "car_makers" VALUES ("6", "Peugeot", "2");
INSERT INTO "car_makers" VALUES ("7", "Citroen", "2");
INSERT INTO "car_makers" VALUES ("8", "Fiat", "3");
INSERT INTO "car_makers" VALUES ("9", "Ferrari", "3");
INSERT INTO "car_makers" VALUES ("10", "Lamborghini", "3");
INSERT INTO "car_makers" VALUES ("11", "Toyota", "4");
INSERT INTO "car_makers" VALUES ("12", "Honda", "4");
INSERT INTO "car_makers" VALUES ("13", "Nissan", "4");
INSERT INTO "car_makers" VALUES ("14", "Ford", "5");
INSERT INTO "car_makers" VALUES ("15", "General Motors", "5");
INSERT INTO "car_makers" VALUES ("16", "Tesla", "5");
INSERT INTO "car_makers" VALUES ("17", "Volvo", "7");
INSERT INTO "car_makers" VALUES ("18", "Saab", "7");
INSERT INTO "car_makers" VALUES ("19", "Hyundai", "8");
INSERT INTO "car_makers" VALUES ("20", "Kia", "8");
INSERT INTO "car_makers" VALUES ("21", "Jaguar", "6");
INSERT INTO "car_makers" VALUES ("22", "Land Rover", "6");
INSERT INTO "car_makers" VALUES ("23", "Mini", "6");
INSERT INTO "car_makers" VALUES ("24", "Aston Martin", "6");
INSERT INTO "car_names" VALUES ("1", "Volkswagen");
INSERT INTO "car_names" VALUES ("2", "BMW");
INSERT INTO "car_names" VALUES ("3", "Mercedes-Benz");
INSERT INTO "car_names" VALUES ("4", "Audi");
INSERT INTO "car_names" VALUES ("5", "Renault");
INSERT INTO "car_names" VALUES ("6", "Peugeot");
INSERT INTO "car_names" VALUES ("7", "Citroen");
INSERT INTO "car_names" VALUES ("8", "Fiat");
INSERT INTO "car_names" VALUES ("9", "Ferrari");
INSERT INTO "car_names" VALUES ("10", "Lamborghini");
INSERT INTO "car_names" VALUES ("11", "Toyota");
INSERT INTO "car_names" VALUES ("12", "Honda");
INSERT INTO "car_names" VALUES ("13", "Nissan");
INSERT INTO "car_names" VALUES ("14", "Ford");
INSERT INTO "car_names" VALUES ("15", "General Motors");
INSERT INTO "car_names" VALUES ("16", "Tesla");
INSERT INTO "car_names" VALUES ("17", "Volvo");
INSERT INTO "car_names" VALUES ("18", "Saab");
INSERT INTO "car_names" VALUES ("19", "Hyundai");
INSERT INTO "car_names" VALUES ("20", "Kia");
INSERT INTO "car_names" VALUES ("21", "Jaguar");
INSERT INTO "car_names" VALUES ("22", "Land Rover");
INSERT INTO "car_names" VALUES ("23", "Mini");
INSERT INTO "car_names" VALUES ("24", "Aston Martin");
INSERT INTO "model_list" VALUES ("1", "Golf");
INSERT INTO "model_list" VALUES ("2", "3 Series");
INSERT INTO "model_list" VALUES ("3", "C-Class");
INSERT INTO "model_list" VALUES ("4", "A4");
INSERT INTO "model_list" VALUES ("5", "Clio");
INSERT INTO "model_list" VALUES ("6", "208");
INSERT INTO "model_list" VALUES ("7", "C3");
INSERT INTO "model_list" VALUES ("8", "500");
INSERT INTO "model_list" VALUES ("9", "488 GTB");
INSERT INTO "model_list" VALUES ("10", "Huracan");
INSERT INTO "model_list" VALUES ("11", "Corolla");
INSERT INTO "model_list" VALUES ("12", "Civic");
INSERT INTO "model_list" VALUES ("13", "Qashqai");
INSERT INTO "model_list" VALUES ("14", "F-150");
INSERT INTO "model_list" VALUES ("15", "Silverado");
INSERT INTO "model_list" VALUES ("16", "Model 3");
INSERT INTO "model_list" VALUES ("17", "XC90");
INSERT INTO "model_list" VALUES ("18", "9-3");
INSERT INTO "model_list" VALUES ("19", "Elantra");
INSERT INTO "model_list" VALUES ("20", "Sportage");
INSERT INTO "model_list" VALUES ("21", "F-Pace");
INSERT INTO "model_list" VALUES ("22", "Range Rover");
INSERT INTO "model_list" VALUES ("23", "Cooper");
INSERT INTO "model_list" VALUES ("24", "DB11");