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 UNIQUE,
"degree_program_id" INT,
"semester_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", "Computer Science");
INSERT INTO "Degree_Programs" VALUES ("2", "Mechanical Engineering");
INSERT INTO "Degree_Programs" VALUES ("3", "Business Administration");
INSERT INTO "Degree_Programs" VALUES ("4", "Psychology");
INSERT INTO "Degree_Programs" VALUES ("5", "Biology");
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", "Winter 2024");
INSERT INTO "Student_Enrolment" VALUES ("1001", "1", "101");
INSERT INTO "Student_Enrolment" VALUES ("1002", "2", "101");
INSERT INTO "Student_Enrolment" VALUES ("1003", "3", "101");
INSERT INTO "Student_Enrolment" VALUES ("1004", "1", "102");
INSERT INTO "Student_Enrolment" VALUES ("1005", "4", "102");
INSERT INTO "Student_Enrolment" VALUES ("1006", "5", "102");
INSERT INTO "Student_Enrolment" VALUES ("1007", "2", "102");
INSERT INTO "Student_Enrolment" VALUES ("1008", "3", "102");
INSERT INTO "Student_Enrolment" VALUES ("1009", "1", "102");
INSERT INTO "Student_Enrolment" VALUES ("1010", "1", "103");
INSERT INTO "Student_Enrolment" VALUES ("1011", "2", "103");
INSERT INTO "Student_Enrolment" VALUES ("1012", "3", "103");
INSERT INTO "Student_Enrolment" VALUES ("1013", "4", "103");
INSERT INTO "Student_Enrolment" VALUES ("1014", "5", "103");
INSERT INTO "Student_Enrolment" VALUES ("1015", "1", "104");
INSERT INTO "Student_Enrolment" VALUES ("1016", "2", "104");
INSERT INTO "Student_Enrolment" VALUES ("1017", "3", "104");
INSERT INTO "Student_Enrolment" VALUES ("1018", "4", "104");
INSERT INTO "Student_Enrolment" VALUES ("1019", "5", "104");
INSERT INTO "Student_Enrolment" VALUES ("1020", "1", "102");
INSERT INTO "Student_Enrolment" VALUES ("1021", "2", "102");
INSERT INTO "Student_Enrolment" VALUES ("1022", "3", "102");
INSERT INTO "Student_Enrolment" VALUES ("1023", "4", "102");
INSERT INTO "Student_Enrolment" VALUES ("1024", "5", "102");
INSERT INTO "Student_Enrolment_Courses" VALUES ("5001", "201");
INSERT INTO "Student_Enrolment_Courses" VALUES ("5002", "202");
INSERT INTO "Student_Enrolment_Courses" VALUES ("5003", "203");
INSERT INTO "Student_Enrolment_Courses" VALUES ("5004", "204");
INSERT INTO "Student_Enrolment_Courses" VALUES ("5005", "205");
INSERT INTO "Student_Enrolment_Courses" VALUES ("5006", "206");
INSERT INTO "Student_Enrolment_Courses" VALUES ("5007", "207");
INSERT INTO "Student_Enrolment_Courses" VALUES ("5008", "208");
INSERT INTO "Student_Enrolment_Courses" VALUES ("5009", "209");
INSERT INTO "Student_Enrolment_Courses" VALUES ("5010", "210");