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,
"Country" TEXT,
PRIMARY KEY ("Id"),
FOREIGN KEY ("Country") REFERENCES "countries"("CountryId")
);

CREATE TABLE "car_names" (
"MakeId" INT,
"Make" TEXT,
PRIMARY KEY ("MakeId")
);

CREATE TABLE "cars_data" (
"Id" INT,
"Year" INT,
PRIMARY KEY ("Id")
);

CREATE TABLE "continents" (
"ContId" INT,
"Continent" TEXT,
PRIMARY KEY ("ContId")
);

CREATE TABLE "countries" (
"CountryId" INT UNIQUE,
"CountryName" TEXT,
PRIMARY KEY ("CountryId")
);

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





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 ("1", "Italy");
INSERT INTO "countries" VALUES ("2", "Germany");
INSERT INTO "countries" VALUES ("3", "USA");
INSERT INTO "countries" VALUES ("4", "Japan");
INSERT INTO "countries" VALUES ("5", "France");
INSERT INTO "countries" VALUES ("6", "UK");
INSERT INTO "countries" VALUES ("7", "Sweden");
INSERT INTO "countries" VALUES ("8", "South Korea");
INSERT INTO "countries" VALUES ("9", "China");
INSERT INTO "countries" VALUES ("10", "India");
INSERT INTO "car_makers" VALUES ("1", "1");
INSERT INTO "car_makers" VALUES ("2", "1");
INSERT INTO "car_makers" VALUES ("3", "1");
INSERT INTO "car_makers" VALUES ("4", "1");
INSERT INTO "car_makers" VALUES ("5", "2");
INSERT INTO "car_makers" VALUES ("6", "2");
INSERT INTO "car_makers" VALUES ("7", "2");
INSERT INTO "car_makers" VALUES ("8", "3");
INSERT INTO "car_makers" VALUES ("9", "3");
INSERT INTO "car_makers" VALUES ("10", "3");
INSERT INTO "car_makers" VALUES ("11", "3");
INSERT INTO "car_makers" VALUES ("12", "4");
INSERT INTO "car_makers" VALUES ("13", "4");
INSERT INTO "car_makers" VALUES ("14", "5");
INSERT INTO "car_makers" VALUES ("15", "6");
INSERT INTO "car_makers" VALUES ("16", "7");
INSERT INTO "car_makers" VALUES ("17", "8");
INSERT INTO "car_names" VALUES ("1", "fiat");
INSERT INTO "car_names" VALUES ("2", "Alfa Romeo");
INSERT INTO "car_names" VALUES ("3", "Lancia");
INSERT INTO "car_names" VALUES ("4", "Ferrari");
INSERT INTO "car_names" VALUES ("5", "BMW");
INSERT INTO "car_names" VALUES ("6", "Mercedes-Benz");
INSERT INTO "car_names" VALUES ("7", "Audi");
INSERT INTO "car_names" VALUES ("8", "Ford");
INSERT INTO "car_names" VALUES ("9", "Chevrolet");
INSERT INTO "car_names" VALUES ("10", "Dodge");
INSERT INTO "car_names" VALUES ("11", "Tesla");
INSERT INTO "car_names" VALUES ("12", "Toyota");
INSERT INTO "car_names" VALUES ("13", "Honda");
INSERT INTO "car_names" VALUES ("14", "Renault");
INSERT INTO "car_names" VALUES ("15", "Jaguar");
INSERT INTO "car_names" VALUES ("16", "Volvo");
INSERT INTO "car_names" VALUES ("17", "Hyundai");
INSERT INTO "cars_data" VALUES ("1", "1970");
INSERT INTO "cars_data" VALUES ("2", "1971");
INSERT INTO "cars_data" VALUES ("3", "1972");
INSERT INTO "cars_data" VALUES ("4", "1973");
INSERT INTO "cars_data" VALUES ("5", "1974");
INSERT INTO "cars_data" VALUES ("6", "1975");
INSERT INTO "cars_data" VALUES ("7", "1976");
INSERT INTO "cars_data" VALUES ("8", "1977");
INSERT INTO "cars_data" VALUES ("9", "1978");
INSERT INTO "cars_data" VALUES ("10", "1979");
INSERT INTO "model_list" VALUES ("1", "1", "Fiat 500");
INSERT INTO "model_list" VALUES ("2", "1", "Fiat Panda");
INSERT INTO "model_list" VALUES ("3", "2", "Alfa Romeo Giulia");
INSERT INTO "model_list" VALUES ("4", "3", "Lancia Delta");
INSERT INTO "model_list" VALUES ("5", "4", "Ferrari 488");
INSERT INTO "model_list" VALUES ("6", "5", "BMW 3 Series");
INSERT INTO "model_list" VALUES ("7", "6", "Mercedes-Benz C-Class");
INSERT INTO "model_list" VALUES ("8", "7", "Audi A4");
INSERT INTO "model_list" VALUES ("9", "8", "Ford F-150");
INSERT INTO "model_list" VALUES ("10", "9", "Chevrolet Silverado");
INSERT INTO "model_list" VALUES ("11", "10", "Dodge Challenger");
INSERT INTO "model_list" VALUES ("12", "11", "Tesla Model S");
INSERT INTO "model_list" VALUES ("13", "12", "Toyota Camry");
INSERT INTO "model_list" VALUES ("14", "13", "Honda Civic");
INSERT INTO "model_list" VALUES ("15", "1", "Fiat Tipo");
INSERT INTO "model_list" VALUES ("16", "1", "Fiat Punto");
INSERT INTO "model_list" VALUES ("17", "14", "Renault Clio");
INSERT INTO "model_list" VALUES ("18", "15", "Jaguar F-Type");
INSERT INTO "model_list" VALUES ("19", "16", "Volvo XC90");
INSERT INTO "model_list" VALUES ("20", "17", "Hyundai Elantra");
INSERT INTO "model_list" VALUES ("21", "1", "fiat");