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 "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", "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 "Students" VALUES ("101", "Alice", "Marie", "Johnson", "alice.johnson@example.com");
INSERT INTO "Students" VALUES ("102", "Bob", "Lee", "Smith", "bob.smith@example.com");
INSERT INTO "Students" VALUES ("103", "Carol", "Ann", "Davis", "carol.davis@example.com");
INSERT INTO "Students" VALUES ("104", "David", "James", "Miller", "david.miller@example.com");
INSERT INTO "Students" VALUES ("105", "Eva", "Louise", "Brown", "eva.brown@example.com");
INSERT INTO "Student_Enrolment" VALUES ("1001", "1", "20201", "101");
INSERT INTO "Student_Enrolment" VALUES ("1002", "1", "20202", "101");
INSERT INTO "Student_Enrolment" VALUES ("1003", "2", "20201", "101");
INSERT INTO "Student_Enrolment" VALUES ("1004", "1", "20203", "101");
INSERT INTO "Student_Enrolment" VALUES ("1005", "3", "20201", "102");
INSERT INTO "Student_Enrolment" VALUES ("1006", "3", "20202", "102");
INSERT INTO "Student_Enrolment" VALUES ("1007", "3", "20203", "102");
INSERT INTO "Student_Enrolment" VALUES ("1008", "4", "20201", "103");
INSERT INTO "Student_Enrolment" VALUES ("1009", "4", "20202", "103");
INSERT INTO "Student_Enrolment" VALUES ("1010", "2", "20201", "104");
INSERT INTO "Student_Enrolment" VALUES ("1011", "2", "20202", "104");
INSERT INTO "Student_Enrolment" VALUES ("1012", "2", "20203", "104");
INSERT INTO "Student_Enrolment" VALUES ("1013", "2", "20204", "104");
INSERT INTO "Student_Enrolment" VALUES ("1014", "1", "20201", "105");