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 "Semesters" (
"semester_id" INT,
"semester_name" VARCHAR(255),
PRIMARY KEY ("semester_id")
);

CREATE TABLE "Student_Enrolment" (
"student_enrolment_id" INT UNIQUE,
"degree_program_id" INT,
"student_id" INT,
PRIMARY KEY ("student_enrolment_id"),
FOREIGN KEY ("student_id") REFERENCES "Students"("student_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")
);

CREATE TABLE "Students" (
"student_id" INT,
"first_name" VARCHAR(80),
PRIMARY KEY ("student_id")
);





INSERT INTO "Degree_Programs" VALUES ("1", "Computer Science");
INSERT INTO "Degree_Programs" VALUES ("2", "Electrical Engineering");
INSERT INTO "Degree_Programs" VALUES ("3", "Mechanical Engineering");
INSERT INTO "Degree_Programs" VALUES ("4", "Business Administration");
INSERT INTO "Degree_Programs" VALUES ("5", "Biology");
INSERT INTO "Degree_Programs" VALUES ("6", "Physics");
INSERT INTO "Degree_Programs" VALUES ("7", "Chemistry");
INSERT INTO "Semesters" VALUES ("1", "Fall 2022");
INSERT INTO "Semesters" VALUES ("2", "Spring 2023");
INSERT INTO "Semesters" VALUES ("3", "Summer 2023");
INSERT INTO "Students" VALUES ("101", "Alice");
INSERT INTO "Students" VALUES ("102", "Bob");
INSERT INTO "Students" VALUES ("103", "Charlie");
INSERT INTO "Students" VALUES ("104", "David");
INSERT INTO "Students" VALUES ("105", "Eve");
INSERT INTO "Students" VALUES ("106", "Frank");
INSERT INTO "Students" VALUES ("107", "Grace");
INSERT INTO "Students" VALUES ("108", "Heidi");
INSERT INTO "Students" VALUES ("109", "Ivan");
INSERT INTO "Students" VALUES ("110", "Judy");
INSERT INTO "Students" VALUES ("111", "Kyle");
INSERT INTO "Students" VALUES ("112", "Liam");
INSERT INTO "Students" VALUES ("113", "Mia");
INSERT INTO "Students" VALUES ("114", "Noah");
INSERT INTO "Students" VALUES ("115", "Olivia");
INSERT INTO "Student_Enrolment" VALUES ("1", "1", "101");
INSERT INTO "Student_Enrolment" VALUES ("2", "1", "102");
INSERT INTO "Student_Enrolment" VALUES ("3", "1", "103");
INSERT INTO "Student_Enrolment" VALUES ("4", "2", "104");
INSERT INTO "Student_Enrolment" VALUES ("5", "2", "105");
INSERT INTO "Student_Enrolment" VALUES ("6", "3", "106");
INSERT INTO "Student_Enrolment" VALUES ("7", "3", "107");
INSERT INTO "Student_Enrolment" VALUES ("8", "3", "108");
INSERT INTO "Student_Enrolment" VALUES ("9", "4", "109");
INSERT INTO "Student_Enrolment" VALUES ("10", "4", "110");
INSERT INTO "Student_Enrolment" VALUES ("11", "1", "111");
INSERT INTO "Student_Enrolment" VALUES ("12", "1", "112");
INSERT INTO "Student_Enrolment" VALUES ("13", "2", "113");
INSERT INTO "Student_Enrolment" VALUES ("14", "3", "114");
INSERT INTO "Student_Enrolment" VALUES ("15", "4", "115");
INSERT INTO "Student_Enrolment" VALUES ("16", "1", "104");
INSERT INTO "Student_Enrolment" VALUES ("17", "1", "105");
INSERT INTO "Student_Enrolment" VALUES ("18", "2", "101");
INSERT INTO "Student_Enrolment" VALUES ("19", "3", "102");
INSERT INTO "Student_Enrolment" VALUES ("20", "4", "103");
INSERT INTO "Student_Enrolment_Courses" VALUES ("1", "1001");
INSERT INTO "Student_Enrolment_Courses" VALUES ("2", "1002");
INSERT INTO "Student_Enrolment_Courses" VALUES ("3", "1003");
INSERT INTO "Student_Enrolment_Courses" VALUES ("4", "2001");
INSERT INTO "Student_Enrolment_Courses" VALUES ("5", "2002");
INSERT INTO "Student_Enrolment_Courses" VALUES ("6", "3001");
INSERT INTO "Student_Enrolment_Courses" VALUES ("7", "3002");
INSERT INTO "Student_Enrolment_Courses" VALUES ("8", "3003");
INSERT INTO "Student_Enrolment_Courses" VALUES ("9", "4001");
INSERT INTO "Student_Enrolment_Courses" VALUES ("10", "4002");
INSERT INTO "Student_Enrolment_Courses" VALUES ("11", "1004");
INSERT INTO "Student_Enrolment_Courses" VALUES ("12", "1005");
INSERT INTO "Student_Enrolment_Courses" VALUES ("13", "2003");
INSERT INTO "Student_Enrolment_Courses" VALUES ("14", "3004");
INSERT INTO "Student_Enrolment_Courses" VALUES ("15", "4003");