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", "United States", "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", "India", "2");
INSERT INTO "countries" VALUES ("100", "Mexico", "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", "Hyundai", "50");
INSERT INTO "car_makers" VALUES ("9", "Kia", "50");
INSERT INTO "car_makers" VALUES ("10", "Chevrolet", "30");
INSERT INTO "car_makers" VALUES ("11", "Ford", "30");
INSERT INTO "car_makers" VALUES ("12", "Tesla", "30");
INSERT INTO "car_makers" VALUES ("13", "Peugeot", "40");
INSERT INTO "car_makers" VALUES ("14", "Renault", "40");
INSERT INTO "car_makers" VALUES ("15", "Fiat", "70");
INSERT INTO "car_makers" VALUES ("16", "Tata Motors", "90");
INSERT INTO "car_makers" VALUES ("17", "Mahindra", "90");
INSERT INTO "car_makers" VALUES ("18", "Maruti Suzuki", "90");
INSERT INTO "car_makers" VALUES ("19", "Dodge", "100");
INSERT INTO "car_makers" VALUES ("20", "Jeep", "100");
INSERT INTO "car_makers" VALUES ("21", "Chrysler", "100");