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 UNIQUE,
"Maker" TEXT,
"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")
);

CREATE TABLE "model_list" (
"ModelId" INT,
"Model" TEXT,
PRIMARY KEY ("ModelId")
);





INSERT INTO "continents" VALUES ("1", "Europe");
INSERT INTO "continents" VALUES ("2", "Asia");
INSERT INTO "continents" VALUES ("3", "North America");
INSERT INTO "continents" VALUES ("4", "Africa");
INSERT INTO "countries" VALUES ("10", "Germany", "1");
INSERT INTO "countries" VALUES ("11", "France", "1");
INSERT INTO "countries" VALUES ("12", "Italy", "1");
INSERT INTO "countries" VALUES ("13", "Spain", "1");
INSERT INTO "countries" VALUES ("20", "Japan", "2");
INSERT INTO "countries" VALUES ("21", "South Korea", "2");
INSERT INTO "countries" VALUES ("30", "USA", "3");
INSERT INTO "countries" VALUES ("31", "Canada", "3");
INSERT INTO "countries" VALUES ("40", "Nigeria", "4");
INSERT INTO "car_makers" VALUES ("100", "BMW", "Bayerische Motoren Werke AG", "10");
INSERT INTO "car_makers" VALUES ("101", "Audi", "Audi AG", "10");
INSERT INTO "car_makers" VALUES ("102", "Mercedes", "Mercedes-Benz Group AG", "10");
INSERT INTO "car_makers" VALUES ("103", "Volkswagen", "Volkswagen AG", "10");
INSERT INTO "car_makers" VALUES ("104", "Peugeot", "Peugeot S.A.", "11");
INSERT INTO "car_makers" VALUES ("105", "Renault", "Renault S.A.", "11");
INSERT INTO "car_makers" VALUES ("106", "Citroen", "Citroën", "11");
INSERT INTO "car_makers" VALUES ("107", "Ferrari", "Ferrari N.V.", "12");
INSERT INTO "car_makers" VALUES ("108", "Fiat", "Fiat Chrysler Automobiles", "12");
INSERT INTO "car_makers" VALUES ("109", "Lancia", "Lancia", "12");
INSERT INTO "car_makers" VALUES ("110", "Seat", "SEAT, S.A.", "13");
INSERT INTO "car_makers" VALUES ("111", "Cupra", "Cupra", "13");
INSERT INTO "car_makers" VALUES ("112", "Hyundai", "Hyundai Motor Company", "21");
INSERT INTO "car_makers" VALUES ("113", "Kia", "Kia Corporation", "21");
INSERT INTO "car_makers" VALUES ("114", "Toyota", "Toyota Motor Corporation", "20");
INSERT INTO "car_makers" VALUES ("115", "Honda", "Honda Motor Co., Ltd.", "20");
INSERT INTO "car_makers" VALUES ("116", "Ford", "Ford Motor Company", "30");
INSERT INTO "car_makers" VALUES ("117", "Chevrolet", "Chevrolet", "30");
INSERT INTO "car_makers" VALUES ("118", "Tesla", "Tesla, Inc.", "30");
INSERT INTO "car_makers" VALUES ("119", "Nissan", "Nissan Motor Corporation", "20");
INSERT INTO "model_list" VALUES ("1000", "3 Series");
INSERT INTO "model_list" VALUES ("1001", "A4");
INSERT INTO "model_list" VALUES ("1002", "C-Class");
INSERT INTO "model_list" VALUES ("1003", "Golf");
INSERT INTO "model_list" VALUES ("1004", "308");
INSERT INTO "model_list" VALUES ("1005", "Clio");
INSERT INTO "model_list" VALUES ("1006", "C3");
INSERT INTO "model_list" VALUES ("1007", "488 Spider");
INSERT INTO "model_list" VALUES ("1008", "500");
INSERT INTO "model_list" VALUES ("1009", "Delta");
INSERT INTO "model_list" VALUES ("1010", "Ibiza");
INSERT INTO "model_list" VALUES ("1011", "Formentor");
INSERT INTO "model_list" VALUES ("1012", "Sonata");
INSERT INTO "model_list" VALUES ("1013", "Sorento");
INSERT INTO "model_list" VALUES ("1014", "Camry");
INSERT INTO "model_list" VALUES ("1015", "Accord");
INSERT INTO "model_list" VALUES ("1016", "F-150");
INSERT INTO "model_list" VALUES ("1017", "Silverado");
INSERT INTO "model_list" VALUES ("1018", "Model S");
INSERT INTO "model_list" VALUES ("1019", "Altima");