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,
"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,
"Continent" TEXT,
PRIMARY KEY ("ContId")
);

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

CREATE TABLE "model_list" (
"ModelId" INT,
"Maker" INT,
PRIMARY KEY ("ModelId"),
FOREIGN KEY ("Maker") REFERENCES "car_makers"("Id")
);





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");
INSERT INTO "countries" VALUES ("2", "Japan");
INSERT INTO "countries" VALUES ("3", "USA");
INSERT INTO "countries" VALUES ("4", "France");
INSERT INTO "countries" VALUES ("5", "Italy");
INSERT INTO "countries" VALUES ("6", "UK");
INSERT INTO "countries" VALUES ("7", "South Korea");
INSERT INTO "countries" VALUES ("8", "Sweden");
INSERT INTO "countries" VALUES ("9", "China");
INSERT INTO "countries" VALUES ("10", "India");
INSERT INTO "car_makers" VALUES ("1", "1");
INSERT INTO "car_makers" VALUES ("2", "1");
INSERT INTO "car_makers" VALUES ("3", "1");
INSERT INTO "car_makers" VALUES ("4", "2");
INSERT INTO "car_makers" VALUES ("5", "2");
INSERT INTO "car_makers" VALUES ("6", "3");
INSERT INTO "car_makers" VALUES ("7", "3");
INSERT INTO "car_makers" VALUES ("8", "3");
INSERT INTO "car_makers" VALUES ("9", "3");
INSERT INTO "car_makers" VALUES ("10", "4");
INSERT INTO "car_makers" VALUES ("11", "4");
INSERT INTO "car_makers" VALUES ("12", "5");
INSERT INTO "car_makers" VALUES ("13", "6");
INSERT INTO "car_makers" VALUES ("14", "7");
INSERT INTO "car_makers" VALUES ("15", "8");
INSERT INTO "car_makers" VALUES ("16", "9");
INSERT INTO "car_makers" VALUES ("17", "9");
INSERT INTO "car_makers" VALUES ("18", "10");
INSERT INTO "car_names" VALUES ("1", "BMW");
INSERT INTO "car_names" VALUES ("2", "Mercedes-Benz");
INSERT INTO "car_names" VALUES ("3", "Audi");
INSERT INTO "car_names" VALUES ("4", "Toyota");
INSERT INTO "car_names" VALUES ("5", "Honda");
INSERT INTO "car_names" VALUES ("6", "Ford");
INSERT INTO "car_names" VALUES ("7", "Chevrolet");
INSERT INTO "car_names" VALUES ("8", "Tesla");
INSERT INTO "car_names" VALUES ("9", "Jeep");
INSERT INTO "car_names" VALUES ("10", "Renault");
INSERT INTO "car_names" VALUES ("11", "Peugeot");
INSERT INTO "car_names" VALUES ("12", "Fiat");
INSERT INTO "car_names" VALUES ("13", "Land Rover");
INSERT INTO "car_names" VALUES ("14", "Hyundai");
INSERT INTO "car_names" VALUES ("15", "Volvo");
INSERT INTO "car_names" VALUES ("16", "BYD");
INSERT INTO "car_names" VALUES ("17", "Geely");
INSERT INTO "car_names" VALUES ("18", "Tata Motors");
INSERT INTO "model_list" VALUES ("101", "1");
INSERT INTO "model_list" VALUES ("102", "1");
INSERT INTO "model_list" VALUES ("103", "2");
INSERT INTO "model_list" VALUES ("104", "3");
INSERT INTO "model_list" VALUES ("105", "4");
INSERT INTO "model_list" VALUES ("106", "4");
INSERT INTO "model_list" VALUES ("107", "5");
INSERT INTO "model_list" VALUES ("108", "6");
INSERT INTO "model_list" VALUES ("109", "6");
INSERT INTO "model_list" VALUES ("110", "7");
INSERT INTO "model_list" VALUES ("111", "8");
INSERT INTO "model_list" VALUES ("112", "9");
INSERT INTO "model_list" VALUES ("113", "10");
INSERT INTO "model_list" VALUES ("114", "11");
INSERT INTO "model_list" VALUES ("115", "12");
INSERT INTO "model_list" VALUES ("116", "13");
INSERT INTO "model_list" VALUES ("117", "14");
INSERT INTO "model_list" VALUES ("118", "15");
INSERT INTO "model_list" VALUES ("119", "16");
INSERT INTO "model_list" VALUES ("120", "17");
INSERT INTO "model_list" VALUES ("121", "18");