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),
PRIMARY KEY ("degree_program_id")
);

CREATE TABLE "Departments" (
"department_id" INT,
"department_name" VARCHAR(255),
PRIMARY KEY ("department_id")
);

CREATE TABLE "Semesters" (
"semester_id" INT UNIQUE,
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")
);

CREATE TABLE "Student_Enrolment_Courses" (
"student_course_id" INT,
"course_id" INT,
PRIMARY KEY ("student_course_id")
);





INSERT INTO "Degree_Programs" VALUES ("1", "Bachelors of Science");
INSERT INTO "Degree_Programs" VALUES ("2", "Masters of Arts");
INSERT INTO "Degree_Programs" VALUES ("3", "Bachelors of Arts");
INSERT INTO "Degree_Programs" VALUES ("4", "Masters of Science");
INSERT INTO "Degree_Programs" VALUES ("5", "PhD in Engineering");
INSERT INTO "Departments" VALUES ("101", "Computer Science");
INSERT INTO "Departments" VALUES ("102", "History");
INSERT INTO "Departments" VALUES ("103", "Mathematics");
INSERT INTO "Departments" VALUES ("104", "English");
INSERT INTO "Departments" VALUES ("105", "Physics");
INSERT INTO "Semesters" VALUES ("202301");
INSERT INTO "Semesters" VALUES ("202302");
INSERT INTO "Semesters" VALUES ("202401");
INSERT INTO "Semesters" VALUES ("202402");
INSERT INTO "Semesters" VALUES ("202501");
INSERT INTO "Student_Enrolment" VALUES ("1", "1", "202301", "1001");
INSERT INTO "Student_Enrolment" VALUES ("2", "3", "202301", "1002");
INSERT INTO "Student_Enrolment" VALUES ("3", "2", "202301", "2001");
INSERT INTO "Student_Enrolment" VALUES ("4", "4", "202301", "2002");
INSERT INTO "Student_Enrolment" VALUES ("5", "1", "202302", "1003");
INSERT INTO "Student_Enrolment" VALUES ("6", "2", "202302", "2003");
INSERT INTO "Student_Enrolment" VALUES ("7", "3", "202401", "1004");
INSERT INTO "Student_Enrolment" VALUES ("8", "4", "202401", "2004");
INSERT INTO "Student_Enrolment" VALUES ("9", "1", "202402", "1005");
INSERT INTO "Student_Enrolment" VALUES ("10", "2", "202402", "2005");
INSERT INTO "Student_Enrolment" VALUES ("11", "5", "202501", "3001");
INSERT INTO "Student_Enrolment" VALUES ("12", "1", "202301", "1006");
INSERT INTO "Student_Enrolment" VALUES ("13", "2", "202301", "2006");
INSERT INTO "Student_Enrolment" VALUES ("14", "3", "202302", "1007");
INSERT INTO "Student_Enrolment" VALUES ("15", "4", "202302", "2007");
INSERT INTO "Student_Enrolment_Courses" VALUES ("1", "501");
INSERT INTO "Student_Enrolment_Courses" VALUES ("2", "502");
INSERT INTO "Student_Enrolment_Courses" VALUES ("3", "601");
INSERT INTO "Student_Enrolment_Courses" VALUES ("4", "602");
INSERT INTO "Student_Enrolment_Courses" VALUES ("5", "503");
INSERT INTO "Student_Enrolment_Courses" VALUES ("6", "603");
INSERT INTO "Student_Enrolment_Courses" VALUES ("7", "504");
INSERT INTO "Student_Enrolment_Courses" VALUES ("8", "604");
INSERT INTO "Student_Enrolment_Courses" VALUES ("9", "505");
INSERT INTO "Student_Enrolment_Courses" VALUES ("10", "605");
INSERT INTO "Student_Enrolment_Courses" VALUES ("11", "701");
INSERT INTO "Student_Enrolment_Courses" VALUES ("12", "506");
INSERT INTO "Student_Enrolment_Courses" VALUES ("13", "606");
INSERT INTO "Student_Enrolment_Courses" VALUES ("14", "507");
INSERT INTO "Student_Enrolment_Courses" VALUES ("15", "607");