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),
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", "BSc Computer Science", "Bachelors");
INSERT INTO "Degree_Programs" VALUES ("2", "MSc Data Science", "Masters");
INSERT INTO "Degree_Programs" VALUES ("3", "BSc Mathematics", "Bachelors");
INSERT INTO "Degree_Programs" VALUES ("4", "MSc Artificial Intelligence", "Masters");
INSERT INTO "Degree_Programs" VALUES ("5", "PhD Physics", "Doctorate");
INSERT INTO "Semesters" VALUES ("101", "Fall 2023");
INSERT INTO "Semesters" VALUES ("102", "Spring 2024");
INSERT INTO "Semesters" VALUES ("103", "Summer 2024");
INSERT INTO "Semesters" VALUES ("104", "Fall 2024");
INSERT INTO "Student_Enrolment" VALUES ("1001", "1", "101", "501");
INSERT INTO "Student_Enrolment" VALUES ("1002", "2", "101", "502");
INSERT INTO "Student_Enrolment" VALUES ("1003", "3", "102", "503");
INSERT INTO "Student_Enrolment" VALUES ("1004", "4", "103", "504");
INSERT INTO "Student_Enrolment" VALUES ("1005", "1", "102", "505");
INSERT INTO "Student_Enrolment" VALUES ("1006", "2", "104", "506");
INSERT INTO "Student_Enrolment" VALUES ("1007", "3", "101", "507");
INSERT INTO "Student_Enrolment" VALUES ("1008", "4", "101", "508");
INSERT INTO "Student_Enrolment" VALUES ("1009", "5", "103", "509");
INSERT INTO "Student_Enrolment" VALUES ("1010", "1", "104", "510");
INSERT INTO "Student_Enrolment" VALUES ("1011", "2", "102", "511");
INSERT INTO "Student_Enrolment" VALUES ("1012", "3", "103", "512");
INSERT INTO "Student_Enrolment" VALUES ("1013", "4", "104", "513");
INSERT INTO "Student_Enrolment" VALUES ("1014", "1", "101", "514");
INSERT INTO "Student_Enrolment" VALUES ("1015", "2", "101", "515");