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),
PRIMARY KEY ("degree_program_id"),
FOREIGN KEY ("department_id") REFERENCES "Departments"("department_id")
);

CREATE TABLE "Departments" (
"department_id" INT UNIQUE,
"department_name" VARCHAR(255),
PRIMARY KEY ("department_id")
);

CREATE TABLE "Semesters" (
"semester_id" INT,
"semester_name" VARCHAR(255),
PRIMARY KEY ("semester_id")
);

CREATE TABLE "Student_Enrolment" (
"student_enrolment_id" INT,
"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 "Students" (
"student_id" INT,
"first_name" VARCHAR(80),
"last_name" VARCHAR(40),
PRIMARY KEY ("student_id")
);





INSERT INTO "Departments" VALUES ("1", "Computer Science");
INSERT INTO "Departments" VALUES ("2", "Electrical Engineering");
INSERT INTO "Departments" VALUES ("3", "Mathematics");
INSERT INTO "Departments" VALUES ("4", "Physics");
INSERT INTO "Departments" VALUES ("5", "Chemistry");
INSERT INTO "Departments" VALUES ("6", "Biology");
INSERT INTO "Degree_Programs" VALUES ("101", "1", "Bachelor of Science in Computer Science");
INSERT INTO "Degree_Programs" VALUES ("102", "1", "Master of Science in Computer Science");
INSERT INTO "Degree_Programs" VALUES ("103", "2", "Bachelor of Science in Electrical Engineering");
INSERT INTO "Degree_Programs" VALUES ("104", "2", "Master of Science in Electrical Engineering");
INSERT INTO "Degree_Programs" VALUES ("105", "3", "Bachelor of Science in Mathematics");
INSERT INTO "Degree_Programs" VALUES ("106", "3", "Master of Science in Mathematics");
INSERT INTO "Degree_Programs" VALUES ("107", "1", "Ph.D. in Computer Science");
INSERT INTO "Degree_Programs" VALUES ("108", "4", "Bachelor of Science in Physics");
INSERT INTO "Students" VALUES ("1", "Alice", "Smith");
INSERT INTO "Students" VALUES ("2", "Bob", "Johnson");
INSERT INTO "Students" VALUES ("3", "Charlie", "Brown");
INSERT INTO "Students" VALUES ("4", "Diana", "Prince");
INSERT INTO "Students" VALUES ("5", "Eve", "Adams");
INSERT INTO "Students" VALUES ("6", "Frank", "White");
INSERT INTO "Students" VALUES ("7", "Grace", "Taylor");
INSERT INTO "Students" VALUES ("8", "Henry", "Miller");
INSERT INTO "Students" VALUES ("9", "Ivy", "Davis");
INSERT INTO "Students" VALUES ("10", "Jack", "Wilson");
INSERT INTO "Students" VALUES ("11", "Karen", "Moore");
INSERT INTO "Students" VALUES ("12", "Liam", "Garcia");
INSERT INTO "Students" VALUES ("13", "Mia", "Rodriguez");
INSERT INTO "Students" VALUES ("14", "Noah", "Martinez");
INSERT INTO "Students" VALUES ("15", "Olivia", "Hernandez");
INSERT INTO "Students" VALUES ("16", "Peter", "Lopez");
INSERT INTO "Students" VALUES ("17", "Quinn", "Gonzalez");
INSERT INTO "Students" VALUES ("18", "Rachel", "Perez");
INSERT INTO "Students" VALUES ("19", "Sam", "Sanchez");
INSERT INTO "Students" VALUES ("20", "Tina", "Ramirez");
INSERT INTO "Student_Enrolment" VALUES ("1", "101", "1");
INSERT INTO "Student_Enrolment" VALUES ("2", "101", "2");
INSERT INTO "Student_Enrolment" VALUES ("3", "101", "3");
INSERT INTO "Student_Enrolment" VALUES ("4", "101", "4");
INSERT INTO "Student_Enrolment" VALUES ("5", "101", "5");
INSERT INTO "Student_Enrolment" VALUES ("6", "103", "6");
INSERT INTO "Student_Enrolment" VALUES ("7", "103", "7");
INSERT INTO "Student_Enrolment" VALUES ("8", "103", "8");
INSERT INTO "Student_Enrolment" VALUES ("9", "105", "9");
INSERT INTO "Student_Enrolment" VALUES ("10", "105", "10");
INSERT INTO "Student_Enrolment" VALUES ("11", "102", "11");
INSERT INTO "Student_Enrolment" VALUES ("12", "102", "12");
INSERT INTO "Student_Enrolment" VALUES ("13", "104", "13");
INSERT INTO "Student_Enrolment" VALUES ("14", "107", "14");
INSERT INTO "Student_Enrolment" VALUES ("15", "101", "15");
INSERT INTO "Student_Enrolment" VALUES ("16", "101", "16");
INSERT INTO "Student_Enrolment" VALUES ("17", "103", "17");
INSERT INTO "Student_Enrolment" VALUES ("18", "105", "18");
INSERT INTO "Student_Enrolment" VALUES ("19", "102", "19");
INSERT INTO "Student_Enrolment" VALUES ("20", "101", "20");
INSERT INTO "Semesters" VALUES ("1", "Fall 2023");
INSERT INTO "Semesters" VALUES ("2", "Spring 2024");
INSERT INTO "Semesters" VALUES ("3", "Summer 2024");