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

CREATE TABLE "continents" (
"ContId" INT,
"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,
"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 ("10", "Germany", "1");
INSERT INTO "countries" VALUES ("20", "Japan", "2");
INSERT INTO "countries" VALUES ("30", "USA", "3");
INSERT INTO "countries" VALUES ("40", "France", "1");
INSERT INTO "countries" VALUES ("50", "South Korea", "2");
INSERT INTO "countries" VALUES ("60", "Brazil", "4");
INSERT INTO "countries" VALUES ("70", "Italy", "1");
INSERT INTO "countries" VALUES ("80", "Canada", "3");
INSERT INTO "countries" VALUES ("90", "Sweden", "1");
INSERT INTO "countries" VALUES ("100", "India", "2");
INSERT INTO "countries" VALUES ("110", "Mexico", "3");
INSERT INTO "countries" VALUES ("120", "Norway", "1");
INSERT INTO "countries" VALUES ("130", "Egypt", "5");
INSERT INTO "countries" VALUES ("140", "Australia", "6");
INSERT INTO "countries" VALUES ("150", "New Zealand", "6");
INSERT INTO "countries" VALUES ("160", "Russia", "1");
INSERT INTO "countries" VALUES ("170", "China", "2");
INSERT INTO "countries" VALUES ("180", "Argentina", "4");
INSERT INTO "countries" VALUES ("190", "Chile", "4");
INSERT INTO "countries" VALUES ("200", "Finland", "1");
INSERT INTO "car_makers" VALUES ("1", "Volkswagen", "10");
INSERT INTO "car_makers" VALUES ("2", "BMW", "10");
INSERT INTO "car_makers" VALUES ("3", "Mercedes-Benz", "10");
INSERT INTO "car_makers" VALUES ("4", "Audi", "10");
INSERT INTO "car_makers" VALUES ("5", "Porsche", "10");
INSERT INTO "car_makers" VALUES ("6", "Toyota", "20");
INSERT INTO "car_makers" VALUES ("7", "Honda", "20");
INSERT INTO "car_makers" VALUES ("8", "Nissan", "20");
INSERT INTO "car_makers" VALUES ("9", "Mazda", "20");
INSERT INTO "car_makers" VALUES ("10", "Subaru", "20");
INSERT INTO "car_makers" VALUES ("11", "Hyundai", "50");
INSERT INTO "car_makers" VALUES ("12", "Kia", "50");
INSERT INTO "car_makers" VALUES ("13", "Ford", "30");
INSERT INTO "car_makers" VALUES ("14", "Chevrolet", "30");
INSERT INTO "car_makers" VALUES ("15", "Tesla", "30");
INSERT INTO "car_makers" VALUES ("16", "Chrysler", "30");
INSERT INTO "car_makers" VALUES ("17", "Fiat", "70");
INSERT INTO "car_makers" VALUES ("18", "Ferrari", "70");
INSERT INTO "car_makers" VALUES ("19", "Peugeot", "40");
INSERT INTO "car_makers" VALUES ("20", "Renault", "40");
INSERT INTO "car_makers" VALUES ("21", "Volvo", "90");
INSERT INTO "car_makers" VALUES ("22", "Saab", "90");
INSERT INTO "car_makers" VALUES ("23", "Tata Motors", "100");
INSERT INTO "car_makers" VALUES ("24", "Mahindra", "100");
INSERT INTO "car_makers" VALUES ("25", "Lada", "160");
INSERT INTO "car_makers" VALUES ("26", "UAZ", "160");
INSERT INTO "car_makers" VALUES ("27", "Polestar", "90");
INSERT INTO "car_makers" VALUES ("28", "Cupra", "10");
INSERT INTO "car_makers" VALUES ("29", "Skoda", "10");
INSERT INTO "car_makers" VALUES ("30", "Dacia", "40");
INSERT INTO "car_makers" VALUES ("31", "Lincoln", "30");
INSERT INTO "car_makers" VALUES ("32", "Cadillac", "30");
INSERT INTO "car_makers" VALUES ("33", "Buick", "30");
INSERT INTO "car_makers" VALUES ("34", "GMC", "30");
INSERT INTO "car_makers" VALUES ("35", "Mitsubishi", "20");
INSERT INTO "car_makers" VALUES ("36", "Suzuki", "20");
INSERT INTO "car_makers" VALUES ("37", "Isuzu", "20");
INSERT INTO "car_makers" VALUES ("38", "Citroen", "40");
INSERT INTO "car_makers" VALUES ("39", "Daihatsu", "20");
INSERT INTO "car_makers" VALUES ("40", "Lexus", "20");
INSERT INTO "car_makers" VALUES ("41", "Holden", "140");
INSERT INTO "car_makers" VALUES ("42", "HSV", "140");
INSERT INTO "car_makers" VALUES ("43", "Ford Australia", "140");
INSERT INTO "car_makers" VALUES ("44", "Renault Samsung", "50");
INSERT INTO "car_makers" VALUES ("45", "Great Wall", "170");
INSERT INTO "car_makers" VALUES ("46", "BYD", "170");
INSERT INTO "car_makers" VALUES ("47", "Geely", "170");
INSERT INTO "car_makers" VALUES ("48", "Chery", "170");
INSERT INTO "car_makers" VALUES ("49", "FAW", "170");
INSERT INTO "car_makers" VALUES ("50", "Troller", "180");
INSERT INTO "car_makers" VALUES ("51", "Haval", "170");
INSERT INTO "car_makers" VALUES ("52", "Zotye", "170");
INSERT INTO "car_makers" VALUES ("53", "Great Wall Motors", "170");
INSERT INTO "car_makers" VALUES ("54", "Proton", "150");
INSERT INTO "car_makers" VALUES ("55", "Perodua", "150");
INSERT INTO "car_makers" VALUES ("56", "NoCarMaker1", "130");
INSERT INTO "car_makers" VALUES ("57", "NoCarMaker2", "130");
INSERT INTO "car_makers" VALUES ("58", "NoCarMaker3", "190");
INSERT INTO "car_makers" VALUES ("59", "NoCarMaker4", "190");
INSERT INTO "car_makers" VALUES ("60", "NoCarMaker5", "60");
INSERT INTO "car_makers" VALUES ("61", "NoCarMaker6", "60");
INSERT INTO "car_makers" VALUES ("62", "NoCarMaker7", "200");
INSERT INTO "car_makers" VALUES ("63", "NoCarMaker8", "200");
INSERT INTO "car_makers" VALUES ("64", "NoCarMaker9", "120");
INSERT INTO "car_makers" VALUES ("65", "NoCarMaker10", "120");
INSERT INTO "car_makers" VALUES ("66", "NoCarMaker11", "110");
INSERT INTO "car_makers" VALUES ("67", "NoCarMaker12", "110");
INSERT INTO "car_makers" VALUES ("68", "NoCarMaker13", "80");
INSERT INTO "car_makers" VALUES ("69", "NoCarMaker14", "80");
INSERT INTO "car_makers" VALUES ("70", "NoCarMaker15", "190");
INSERT INTO "car_makers" VALUES ("71", "NoCarMaker16", "190");
INSERT INTO "car_makers" VALUES ("72", "NoCarMaker17", "130");
INSERT INTO "car_makers" VALUES ("73", "NoCarMaker18", "130");
INSERT INTO "car_makers" VALUES ("74", "NoCarMaker19", "60");
INSERT INTO "car_makers" VALUES ("75", "NoCarMaker20", "60");