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





INSERT INTO "continents" VALUES ("1", "Asia");
INSERT INTO "continents" VALUES ("2", "Europe");
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", "Japan", "1");
INSERT INTO "countries" VALUES ("11", "South Korea", "1");
INSERT INTO "countries" VALUES ("20", "Germany", "2");
INSERT INTO "countries" VALUES ("21", "France", "2");
INSERT INTO "countries" VALUES ("22", "Italy", "2");
INSERT INTO "countries" VALUES ("30", "United States", "3");
INSERT INTO "countries" VALUES ("31", "Canada", "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 "car_makers" VALUES ("100", "Toyota", "10");
INSERT INTO "car_makers" VALUES ("101", "Honda", "10");
INSERT INTO "car_makers" VALUES ("102", "Hyundai", "11");
INSERT INTO "car_makers" VALUES ("103", "Kia", "11");
INSERT INTO "car_makers" VALUES ("104", "BMW", "20");
INSERT INTO "car_makers" VALUES ("105", "Mercedes-Benz", "20");
INSERT INTO "car_makers" VALUES ("106", "Volkswagen", "20");
INSERT INTO "car_makers" VALUES ("107", "Renault", "21");
INSERT INTO "car_makers" VALUES ("108", "Peugeot", "21");
INSERT INTO "car_makers" VALUES ("109", "Ferrari", "22");
INSERT INTO "car_makers" VALUES ("110", "Lamborghini", "22");
INSERT INTO "car_makers" VALUES ("111", "Ford", "30");
INSERT INTO "car_makers" VALUES ("112", "Chevrolet", "30");
INSERT INTO "car_makers" VALUES ("113", "Tesla", "30");
INSERT INTO "car_makers" VALUES ("114", "Honda Canada", "31");
INSERT INTO "car_makers" VALUES ("115", "Volkswagen Brazil", "40");
INSERT INTO "car_makers" VALUES ("116", "Toyota South Africa", "50");
INSERT INTO "car_makers" VALUES ("117", "Holden", "60");