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

CREATE TABLE "Semesters" (
"semester_id" INT UNIQUE,
"semester_name" VARCHAR(255),
"semester_description" 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", "Bachelor of Science", "Bachelor");
INSERT INTO "Degree_Programs" VALUES ("2", "Master of Science", "Master");
INSERT INTO "Degree_Programs" VALUES ("3", "Bachelor of Arts", "Bachelor");
INSERT INTO "Degree_Programs" VALUES ("4", "Master of Arts", "Master");
INSERT INTO "Degree_Programs" VALUES ("5", "Doctorate of Philosophy", "Doctorate");
INSERT INTO "Semesters" VALUES ("1", "Fall 2023", "Fall semester of 2023");
INSERT INTO "Semesters" VALUES ("2", "Spring 2024", "Spring semester of 2024");
INSERT INTO "Semesters" VALUES ("3", "Summer 2024", "Summer semester of 2024");
INSERT INTO "Semesters" VALUES ("4", "Fall 2024", "Fall semester of 2024");
INSERT INTO "Semesters" VALUES ("5", "Spring 2025", "Spring semester of 2025");
INSERT INTO "Student_Enrolment" VALUES ("1", "1", "1", "101");
INSERT INTO "Student_Enrolment" VALUES ("2", "2", "1", "201");
INSERT INTO "Student_Enrolment" VALUES ("3", "3", "2", "102");
INSERT INTO "Student_Enrolment" VALUES ("4", "4", "2", "202");
INSERT INTO "Student_Enrolment" VALUES ("5", "1", "3", "103");
INSERT INTO "Student_Enrolment" VALUES ("6", "2", "4", "203");
INSERT INTO "Student_Enrolment" VALUES ("7", "3", "4", "104");
INSERT INTO "Student_Enrolment" VALUES ("8", "4", "4", "204");
INSERT INTO "Student_Enrolment" VALUES ("9", "1", "5", "105");
INSERT INTO "Student_Enrolment" VALUES ("10", "5", "5", "301");
INSERT INTO "Student_Enrolment" VALUES ("11", "2", "5", "205");
INSERT INTO "Student_Enrolment" VALUES ("12", "4", "3", "206");
INSERT INTO "Student_Enrolment" VALUES ("13", "3", "1", "106");
INSERT INTO "Student_Enrolment" VALUES ("14", "1", "2", "107");
INSERT INTO "Student_Enrolment" VALUES ("15", "2", "2", "207");