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,
"FullName" 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")
);





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", "Brazil", "4");
INSERT INTO "countries" VALUES ("50", "South Africa", "5");
INSERT INTO "countries" VALUES ("60", "Australia", "6");
INSERT INTO "countries" VALUES ("70", "France", "1");
INSERT INTO "countries" VALUES ("80", "South Korea", "2");
INSERT INTO "countries" VALUES ("90", "Canada", "3");
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", "Toyota", "20");
INSERT INTO "car_makers" VALUES ("6", "Honda", "20");
INSERT INTO "car_makers" VALUES ("7", "Nissan", "20");
INSERT INTO "car_makers" VALUES ("8", "Mazda", "20");
INSERT INTO "car_makers" VALUES ("9", "Ford", "30");
INSERT INTO "car_makers" VALUES ("10", "Chevrolet", "30");
INSERT INTO "car_makers" VALUES ("11", "Tesla", "30");
INSERT INTO "car_makers" VALUES ("12", "Dodge", "30");
INSERT INTO "car_makers" VALUES ("13", "Fiat", "40");
INSERT INTO "car_makers" VALUES ("14", "Volkswagen Brazil", "40");
INSERT INTO "car_makers" VALUES ("15", "Renault Brazil", "40");
INSERT INTO "car_makers" VALUES ("16", "Hyundai", "80");
INSERT INTO "car_makers" VALUES ("17", "Kia", "80");
INSERT INTO "car_makers" VALUES ("18", "SsangYong", "80");
INSERT INTO "car_makers" VALUES ("19", "Peugeot", "70");
INSERT INTO "car_makers" VALUES ("20", "Citroen", "70");
INSERT INTO "car_makers" VALUES ("21", "Renault", "70");
INSERT INTO "car_makers" VALUES ("22", "Opel", "70");
INSERT INTO "car_makers" VALUES ("23", "Jaguar", "90");
INSERT INTO "car_makers" VALUES ("24", "Lincoln", "90");
INSERT INTO "car_makers" VALUES ("25", "Acura", "20");
INSERT INTO "car_makers" VALUES ("26", "Mitsubishi", "20");
INSERT INTO "car_makers" VALUES ("27", "Subaru", "20");
INSERT INTO "car_makers" VALUES ("28", "Chrysler", "30");
INSERT INTO "car_makers" VALUES ("29", "GMC", "30");
INSERT INTO "car_makers" VALUES ("30", "Buick", "30");