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 "employee" (
"Employee_ID" INT UNIQUE,
PRIMARY KEY ("Employee_ID")
);

CREATE TABLE "evaluation" (
"Employee_ID" TEXT,
"Year_awarded" TEXT,
PRIMARY KEY ("Employee_ID", "Year_awarded")
);

CREATE TABLE "hiring" (
"Shop_ID" INT,
"Employee_ID" INT,
PRIMARY KEY ("Employee_ID"),
FOREIGN KEY ("Employee_ID") REFERENCES "employee"("Employee_ID"),
FOREIGN KEY ("Shop_ID") REFERENCES "shop"("Shop_ID")
);

CREATE TABLE "shop" (
"Shop_ID" INT UNIQUE,
"Name" TEXT,
"Location" TEXT,
PRIMARY KEY ("Shop_ID")
);





INSERT INTO "employee" VALUES ("101");
INSERT INTO "employee" VALUES ("102");
INSERT INTO "employee" VALUES ("103");
INSERT INTO "employee" VALUES ("104");
INSERT INTO "employee" VALUES ("105");
INSERT INTO "employee" VALUES ("106");
INSERT INTO "employee" VALUES ("107");
INSERT INTO "employee" VALUES ("108");
INSERT INTO "employee" VALUES ("109");
INSERT INTO "employee" VALUES ("110");
INSERT INTO "shop" VALUES ("1", "Green Grocers", "Downtown");
INSERT INTO "shop" VALUES ("2", "Tech Hub", "Midtown");
INSERT INTO "shop" VALUES ("3", "Book Nook", "Uptown");
INSERT INTO "shop" VALUES ("4", "Fashion Point", "Suburb");
INSERT INTO "shop" VALUES ("5", "Gadget World", "Downtown");
INSERT INTO "hiring" VALUES ("1", "101");
INSERT INTO "hiring" VALUES ("1", "102");
INSERT INTO "hiring" VALUES ("2", "103");
INSERT INTO "hiring" VALUES ("2", "104");
INSERT INTO "hiring" VALUES ("2", "105");
INSERT INTO "hiring" VALUES ("3", "106");
INSERT INTO "hiring" VALUES ("4", "107");
INSERT INTO "hiring" VALUES ("4", "108");
INSERT INTO "hiring" VALUES ("5", "109");
INSERT INTO "hiring" VALUES ("5", "110");
INSERT INTO "evaluation" VALUES ("101", "2020");
INSERT INTO "evaluation" VALUES ("101", "2021");
INSERT INTO "evaluation" VALUES ("102", "2021");
INSERT INTO "evaluation" VALUES ("103", "2019");
INSERT INTO "evaluation" VALUES ("104", "2020");
INSERT INTO "evaluation" VALUES ("105", "2021");
INSERT INTO "evaluation" VALUES ("106", "2022");
INSERT INTO "evaluation" VALUES ("107", "2020");
INSERT INTO "evaluation" VALUES ("108", "2021");
INSERT INTO "evaluation" VALUES ("109", "2019");
INSERT INTO "evaluation" VALUES ("110", "2020");