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 "countries" VALUES ("11", "Spain", "1");
INSERT INTO "countries" VALUES ("12", "Canada", "3");
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", "Porsche", "1");
INSERT INTO "car_makers" VALUES ("6", "Renault", "2");
INSERT INTO "car_makers" VALUES ("7", "Peugeot", "2");
INSERT INTO "car_makers" VALUES ("8", "Citroen", "2");
INSERT INTO "car_makers" VALUES ("9", "Fiat", "3");
INSERT INTO "car_makers" VALUES ("10", "Ferrari", "3");
INSERT INTO "car_makers" VALUES ("11", "Lamborghini", "3");
INSERT INTO "car_makers" VALUES ("12", "Toyota", "4");
INSERT INTO "car_makers" VALUES ("13", "Honda", "4");
INSERT INTO "car_makers" VALUES ("14", "Nissan", "4");
INSERT INTO "car_makers" VALUES ("15", "Ford", "5");
INSERT INTO "car_makers" VALUES ("16", "General Motors", "5");
INSERT INTO "car_makers" VALUES ("17", "Chrysler", "5");
INSERT INTO "car_makers" VALUES ("18", "Vauxhall", "6");
INSERT INTO "car_makers" VALUES ("19", "Jaguar", "6");
INSERT INTO "car_makers" VALUES ("20", "Land Rover", "6");
INSERT INTO "car_makers" VALUES ("21", "Volvo", "7");
INSERT INTO "car_makers" VALUES ("22", "Saab", "7");
INSERT INTO "car_makers" VALUES ("23", "Hyundai", "8");
INSERT INTO "car_makers" VALUES ("24", "Kia", "8");
INSERT INTO "car_makers" VALUES ("25", "Geely", "9");
INSERT INTO "car_makers" VALUES ("26", "Tata Motors", "10");
INSERT INTO "car_makers" VALUES ("27", "SEAT", "11");
INSERT INTO "car_makers" VALUES ("28", "McLaren", "6");
INSERT INTO "car_makers" VALUES ("29", "Aston Martin", "6");
INSERT INTO "car_makers" VALUES ("30", "Bugatti", "2");
INSERT INTO "car_makers" VALUES ("31", "Maserati", "3");
INSERT INTO "car_makers" VALUES ("32", "Alfa Romeo", "3");
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", "Porsche");
INSERT INTO "car_names" VALUES ("6", "Renault");
INSERT INTO "car_names" VALUES ("7", "Peugeot");
INSERT INTO "car_names" VALUES ("8", "Citroen");
INSERT INTO "car_names" VALUES ("9", "Fiat");
INSERT INTO "car_names" VALUES ("10", "Ferrari");
INSERT INTO "car_names" VALUES ("11", "Lamborghini");
INSERT INTO "car_names" VALUES ("12", "Toyota");
INSERT INTO "car_names" VALUES ("13", "Honda");
INSERT INTO "car_names" VALUES ("14", "Nissan");
INSERT INTO "car_names" VALUES ("15", "Ford");
INSERT INTO "car_names" VALUES ("16", "General Motors");
INSERT INTO "car_names" VALUES ("17", "Chrysler");
INSERT INTO "car_names" VALUES ("18", "Vauxhall");
INSERT INTO "car_names" VALUES ("19", "Jaguar");
INSERT INTO "car_names" VALUES ("20", "Land Rover");
INSERT INTO "car_names" VALUES ("21", "Volvo");
INSERT INTO "car_names" VALUES ("22", "Saab");
INSERT INTO "car_names" VALUES ("23", "Hyundai");
INSERT INTO "car_names" VALUES ("24", "Kia");
INSERT INTO "car_names" VALUES ("25", "Geely");
INSERT INTO "car_names" VALUES ("26", "Tata Motors");
INSERT INTO "car_names" VALUES ("27", "SEAT");
INSERT INTO "car_names" VALUES ("28", "McLaren");
INSERT INTO "car_names" VALUES ("29", "Aston Martin");
INSERT INTO "car_names" VALUES ("30", "Bugatti");
INSERT INTO "car_names" VALUES ("31", "Maserati");
INSERT INTO "car_names" VALUES ("32", "Alfa Romeo");
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", "911");
INSERT INTO "model_list" VALUES ("6", "Clio");
INSERT INTO "model_list" VALUES ("7", "208");
INSERT INTO "model_list" VALUES ("8", "C3");
INSERT INTO "model_list" VALUES ("9", "500");
INSERT INTO "model_list" VALUES ("10", "488 GTB");
INSERT INTO "model_list" VALUES ("11", "Huracan");
INSERT INTO "model_list" VALUES ("12", "Corolla");
INSERT INTO "model_list" VALUES ("13", "Civic");
INSERT INTO "model_list" VALUES ("14", "Altima");
INSERT INTO "model_list" VALUES ("15", "F-150");
INSERT INTO "model_list" VALUES ("16", "Silverado");
INSERT INTO "model_list" VALUES ("17", "Ram 1500");
INSERT INTO "model_list" VALUES ("18", "Corsa");
INSERT INTO "model_list" VALUES ("19", "F-Type");
INSERT INTO "model_list" VALUES ("20", "Range Rover");
INSERT INTO "model_list" VALUES ("21", "XC90");
INSERT INTO "model_list" VALUES ("22", "9-3");
INSERT INTO "model_list" VALUES ("23", "Elantra");
INSERT INTO "model_list" VALUES ("24", "Sportage");
INSERT INTO "model_list" VALUES ("25", "Emgrand");
INSERT INTO "model_list" VALUES ("26", "Nexon");
INSERT INTO "model_list" VALUES ("27", "Leon");
INSERT INTO "model_list" VALUES ("28", "720S");
INSERT INTO "model_list" VALUES ("29", "DB11");
INSERT INTO "model_list" VALUES ("30", "Chiron");
INSERT INTO "model_list" VALUES ("31", "Ghibli");
INSERT INTO "model_list" VALUES ("32", "Giulia");