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,
"department_id" INT,
"degree_summary_name" VARCHAR(255),
"degree_summary_description" VARCHAR(255),
PRIMARY KEY ("degree_program_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 ("student_id") REFERENCES "Students"("student_id"),
FOREIGN KEY ("degree_program_id") REFERENCES "Degree_Programs"("degree_program_id")
);

CREATE TABLE "Students" (
"student_id" INT UNIQUE,
"first_name" VARCHAR(80),
"middle_name" VARCHAR(40),
"last_name" VARCHAR(40),
"email_address" VARCHAR(40),
PRIMARY KEY ("student_id")
);





INSERT INTO "Degree_Programs" VALUES ("1", "10", "BSc Computer Science", "Bachelors in Computer Science");
INSERT INTO "Degree_Programs" VALUES ("2", "11", "MSc Data Science", "Masters in Data Science");
INSERT INTO "Degree_Programs" VALUES ("3", "12", "BSc Mathematics", "Bachelors in Mathematics");
INSERT INTO "Degree_Programs" VALUES ("4", "13", "PhD Physics", "Doctorate in Physics");
INSERT INTO "Degree_Programs" VALUES ("5", "14", "Bachelors of Arts", "Bachelors in Arts");
INSERT INTO "Degree_Programs" VALUES ("6", "15", "Associate Degree in Business", "Associate Degree in Business");
INSERT INTO "Students" VALUES ("101", "Alice", "Marie", "Johnson", "alice.johnson@example.edu");
INSERT INTO "Students" VALUES ("102", "Bob", "Lee", "Smith", "bob.smith@example.edu");
INSERT INTO "Students" VALUES ("103", "Charlie", "K", "Brown", "charlie.brown@example.edu");
INSERT INTO "Students" VALUES ("104", "Diana", "Faye", "Miller", "diana.miller@example.edu");
INSERT INTO "Students" VALUES ("105", "Ethan", "James", "Davis", "ethan.davis@example.edu");
INSERT INTO "Students" VALUES ("106", "Fiona", "Grace", "Wilson", "fiona.wilson@example.edu");
INSERT INTO "Students" VALUES ("107", "George", "H", "Moore", "george.moore@example.edu");
INSERT INTO "Students" VALUES ("108", "Hannah", "Irene", "Taylor", "hannah.taylor@example.edu");
INSERT INTO "Student_Enrolment" VALUES ("201", "1", "202201", "101");
INSERT INTO "Student_Enrolment" VALUES ("202", "2", "202201", "102");
INSERT INTO "Student_Enrolment" VALUES ("203", "3", "202201", "103");
INSERT INTO "Student_Enrolment" VALUES ("204", "4", "202201", "104");
INSERT INTO "Student_Enrolment" VALUES ("205", "5", "202201", "105");
INSERT INTO "Student_Enrolment" VALUES ("206", "6", "202201", "106");
INSERT INTO "Student_Enrolment" VALUES ("207", "1", "202202", "107");
INSERT INTO "Student_Enrolment" VALUES ("208", "3", "202202", "108");
INSERT INTO "Student_Enrolment" VALUES ("209", "5", "202202", "101");
INSERT INTO "Student_Enrolment" VALUES ("210", "1", "202203", "102");