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,
"Maker" TEXT,
"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", "France", "1");
INSERT INTO "countries" VALUES ("20", "Germany", "1");
INSERT INTO "countries" VALUES ("30", "Japan", "2");
INSERT INTO "countries" VALUES ("40", "United States", "3");
INSERT INTO "countries" VALUES ("50", "Brazil", "4");
INSERT INTO "countries" VALUES ("60", "South Africa", "5");
INSERT INTO "countries" VALUES ("70", "Australia", "6");
INSERT INTO "car_makers" VALUES ("100", "Peugeot", "Peugeot S.A.", "10");
INSERT INTO "car_makers" VALUES ("101", "Renault", "Renault Group", "10");
INSERT INTO "car_makers" VALUES ("102", "Citroen", "Citroën", "10");
INSERT INTO "car_makers" VALUES ("103", "Bugatti", "Bugatti Automobiles S.A.S.", "10");
INSERT INTO "car_makers" VALUES ("104", "DS Automobiles", "DS Automobiles", "10");
INSERT INTO "car_makers" VALUES ("200", "Volkswagen", "Volkswagen AG", "20");
INSERT INTO "car_makers" VALUES ("201", "BMW", "Bayerische Motoren Werke AG", "20");
INSERT INTO "car_makers" VALUES ("300", "Toyota", "Toyota Motor Corporation", "30");
INSERT INTO "car_makers" VALUES ("301", "Honda", "Honda Motor Co., Ltd.", "30");
INSERT INTO "car_makers" VALUES ("400", "Ford", "Ford Motor Company", "40");
INSERT INTO "car_makers" VALUES ("401", "Chevrolet", "Chevrolet Division", "40");
INSERT INTO "car_makers" VALUES ("500", "Fiat", "Fiat Automobiles", "1");
INSERT INTO "car_makers" VALUES ("600", "Tata Motors", "Tata Motors Limited", "2");
INSERT INTO "car_makers" VALUES ("700", "Hyundai", "Hyundai Motor Company", "2");