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





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 "continents" VALUES ("7", "Antarctica");
INSERT INTO "countries" VALUES ("101", "Japan");
INSERT INTO "countries" VALUES ("102", "Germany");
INSERT INTO "countries" VALUES ("103", "United States");
INSERT INTO "countries" VALUES ("104", "Brazil");
INSERT INTO "countries" VALUES ("105", "South Africa");
INSERT INTO "countries" VALUES ("106", "Australia");
INSERT INTO "countries" VALUES ("107", "Argentina");
INSERT INTO "countries" VALUES ("108", "France");
INSERT INTO "countries" VALUES ("109", "Canada");
INSERT INTO "countries" VALUES ("110", "China");
INSERT INTO "car_makers" VALUES ("1", "101");
INSERT INTO "car_makers" VALUES ("2", "102");
INSERT INTO "car_makers" VALUES ("3", "103");
INSERT INTO "car_makers" VALUES ("4", "104");
INSERT INTO "car_makers" VALUES ("5", "105");
INSERT INTO "car_makers" VALUES ("6", "106");
INSERT INTO "car_makers" VALUES ("7", "107");
INSERT INTO "car_makers" VALUES ("8", "108");
INSERT INTO "car_makers" VALUES ("9", "109");
INSERT INTO "car_makers" VALUES ("10", "110");