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

CREATE TABLE "model_list" (
"ModelId" INT,
"Maker" INT,
"Model" TEXT,
PRIMARY KEY ("ModelId"),
FOREIGN KEY ("Maker") REFERENCES "car_makers"("Id")
);





INSERT INTO "countries" VALUES ("1", "Italy", "1");
INSERT INTO "countries" VALUES ("2", "Germany", "1");
INSERT INTO "countries" VALUES ("3", "Japan", "1");
INSERT INTO "countries" VALUES ("4", "USA", "1");
INSERT INTO "countries" VALUES ("5", "France", "1");
INSERT INTO "countries" VALUES ("6", "South Korea", "1");
INSERT INTO "countries" VALUES ("7", "Sweden", "1");
INSERT INTO "car_makers" VALUES ("1", "fiat", "Fiat Chrysler Automobiles", "1");
INSERT INTO "car_makers" VALUES ("2", "Ferrari", "Ferrari S.p.A.", "1");
INSERT INTO "car_makers" VALUES ("3", "Lancia", "Lancia Automobiles", "1");
INSERT INTO "car_makers" VALUES ("4", "Alfa Romeo", "Alfa Romeo Automobiles", "1");
INSERT INTO "car_makers" VALUES ("5", "Volkswagen", "Volkswagen AG", "2");
INSERT INTO "car_makers" VALUES ("6", "BMW", "Bayerische Motoren Werke AG", "2");
INSERT INTO "car_makers" VALUES ("7", "Audi", "Audi AG", "2");
INSERT INTO "car_makers" VALUES ("8", "Mercedes", "Mercedes-Benz", "2");
INSERT INTO "car_makers" VALUES ("9", "Toyota", "Toyota Motor Corporation", "3");
INSERT INTO "car_makers" VALUES ("10", "Honda", "Honda Motor Co., Ltd.", "3");
INSERT INTO "car_makers" VALUES ("11", "Ford", "Ford Motor Company", "4");
INSERT INTO "car_makers" VALUES ("12", "Chevrolet", "Chevrolet Division", "4");
INSERT INTO "car_makers" VALUES ("13", "Peugeot", "Peugeot S.A.", "5");
INSERT INTO "car_makers" VALUES ("14", "Renault", "Renault S.A.", "5");
INSERT INTO "car_makers" VALUES ("15", "Hyundai", "Hyundai Motor Company", "6");
INSERT INTO "car_makers" VALUES ("16", "Kia", "Kia Motors", "6");
INSERT INTO "car_makers" VALUES ("17", "Volvo", "Volvo Cars", "7");
INSERT INTO "model_list" VALUES ("1", "1", "500");
INSERT INTO "model_list" VALUES ("2", "1", "Panda");
INSERT INTO "model_list" VALUES ("3", "2", "488 Spider");
INSERT INTO "model_list" VALUES ("4", "3", "Delta");
INSERT INTO "model_list" VALUES ("5", "4", "Giulia");
INSERT INTO "model_list" VALUES ("6", "5", "Golf");
INSERT INTO "model_list" VALUES ("7", "6", "X5");
INSERT INTO "model_list" VALUES ("8", "7", "A4");
INSERT INTO "model_list" VALUES ("9", "8", "C-Class");
INSERT INTO "model_list" VALUES ("10", "9", "Corolla");
INSERT INTO "model_list" VALUES ("11", "10", "Civic");
INSERT INTO "model_list" VALUES ("12", "11", "Mustang");
INSERT INTO "model_list" VALUES ("13", "12", "Camaro");
INSERT INTO "model_list" VALUES ("14", "13", "208");
INSERT INTO "model_list" VALUES ("15", "14", "Clio");
INSERT INTO "model_list" VALUES ("16", "15", "Elantra");
INSERT INTO "model_list" VALUES ("17", "16", "Sorento");
INSERT INTO "model_list" VALUES ("18", "17", "XC90");