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 ("101", "Japan", "1");
INSERT INTO "countries" VALUES ("102", "Germany", "2");
INSERT INTO "countries" VALUES ("103", "United States", "3");
INSERT INTO "countries" VALUES ("104", "Brazil", "4");
INSERT INTO "countries" VALUES ("105", "South Africa", "5");
INSERT INTO "countries" VALUES ("106", "Australia", "6");
INSERT INTO "countries" VALUES ("107", "France", "2");
INSERT INTO "countries" VALUES ("108", "Canada", "3");
INSERT INTO "countries" VALUES ("109", "India", "1");
INSERT INTO "countries" VALUES ("110", "Argentina", "4");
INSERT INTO "car_makers" VALUES ("1", "Toyota", "101");
INSERT INTO "car_makers" VALUES ("2", "Volkswagen", "102");
INSERT INTO "car_makers" VALUES ("3", "Ford", "103");
INSERT INTO "car_makers" VALUES ("4", "Chevrolet", "103");
INSERT INTO "car_makers" VALUES ("5", "Hyundai", "101");
INSERT INTO "car_makers" VALUES ("6", "Renault", "107");
INSERT INTO "car_makers" VALUES ("7", "Honda", "101");
INSERT INTO "car_makers" VALUES ("8", "BMW", "102");
INSERT INTO "car_makers" VALUES ("9", "Fiat", "107");
INSERT INTO "car_makers" VALUES ("10", "Nissan", "101");