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 "Degree_Programs" (
"degree_program_id" INT,
"degree_summary_name" VARCHAR(255),
PRIMARY KEY ("degree_program_id")
);

CREATE TABLE "Semesters" (
"semester_id" INT UNIQUE,
"semester_name" VARCHAR(255),
PRIMARY KEY ("semester_id")
);

CREATE TABLE "Student_Enrolment" (
"student_enrolment_id" INT,
"degree_program_id" INT,
"semester_id" INT,
"student_id" INT,
PRIMARY KEY ("student_enrolment_id"),
FOREIGN KEY ("semester_id") REFERENCES "Semesters"("semester_id"),
FOREIGN KEY ("degree_program_id") REFERENCES "Degree_Programs"("degree_program_id")
);





INSERT INTO "Degree_Programs" VALUES ("1", "Computer Science");
INSERT INTO "Degree_Programs" VALUES ("2", "Electrical Engineering");
INSERT INTO "Degree_Programs" VALUES ("3", "Mathematics");
INSERT INTO "Degree_Programs" VALUES ("4", "Physics");
INSERT INTO "Degree_Programs" VALUES ("5", "Chemistry");
INSERT INTO "Semesters" VALUES ("101", "Fall 2022");
INSERT INTO "Semesters" VALUES ("102", "Spring 2023");
INSERT INTO "Semesters" VALUES ("103", "Summer 2023");
INSERT INTO "Semesters" VALUES ("104", "Fall 2023");
INSERT INTO "Semesters" VALUES ("105", "Spring 2024");
INSERT INTO "Semesters" VALUES ("106", "Summer 2024");
INSERT INTO "Semesters" VALUES ("107", "Fall 2024");
INSERT INTO "Student_Enrolment" VALUES ("1", "1", "101", "1001");
INSERT INTO "Student_Enrolment" VALUES ("2", "2", "101", "1002");
INSERT INTO "Student_Enrolment" VALUES ("3", "1", "102", "1001");
INSERT INTO "Student_Enrolment" VALUES ("4", "3", "102", "1003");
INSERT INTO "Student_Enrolment" VALUES ("5", "4", "104", "1004");
INSERT INTO "Student_Enrolment" VALUES ("6", "1", "104", "1005");
INSERT INTO "Student_Enrolment" VALUES ("7", "2", "105", "1006");
INSERT INTO "Student_Enrolment" VALUES ("8", "3", "105", "1007");
INSERT INTO "Student_Enrolment" VALUES ("9", "1", "101", "1008");
INSERT INTO "Student_Enrolment" VALUES ("10", "5", "102", "1009");