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,
"semester_id" INT,
"student_id" INT,
PRIMARY KEY ("student_enrolment_id"),
FOREIGN KEY ("student_id") REFERENCES "Students"("student_id"),
FOREIGN KEY ("semester_id") REFERENCES "Semesters"("semester_id")
);

CREATE TABLE "Students" (
"student_id" INT,
"first_name" VARCHAR(80),
"last_name" VARCHAR(40),
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", "Mathematics");
INSERT INTO "Degree_Programs" VALUES ("4", "Physics");
INSERT INTO "Degree_Programs" VALUES ("5", "Chemistry");
INSERT INTO "Semesters" VALUES ("101", "Fall 2022");
INSERT INTO "Semesters" VALUES ("102", "Spring 2023");
INSERT INTO "Semesters" VALUES ("103", "Summer 2023");
INSERT INTO "Semesters" VALUES ("104", "Fall 2023");
INSERT INTO "Semesters" VALUES ("105", "Spring 2024");
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 "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", "102", "1");
INSERT INTO "Student_Enrolment" VALUES ("7", "102", "2");
INSERT INTO "Student_Enrolment" VALUES ("8", "102", "6");
INSERT INTO "Student_Enrolment" VALUES ("9", "102", "7");
INSERT INTO "Student_Enrolment" VALUES ("10", "103", "3");
INSERT INTO "Student_Enrolment" VALUES ("11", "103", "8");
INSERT INTO "Student_Enrolment" VALUES ("12", "104", "1");
INSERT INTO "Student_Enrolment" VALUES ("13", "104", "2");
INSERT INTO "Student_Enrolment" VALUES ("14", "104", "3");
INSERT INTO "Student_Enrolment" VALUES ("15", "104", "4");
INSERT INTO "Student_Enrolment" VALUES ("16", "104", "5");
INSERT INTO "Student_Enrolment" VALUES ("17", "104", "6");
INSERT INTO "Student_Enrolment" VALUES ("18", "104", "7");
INSERT INTO "Student_Enrolment" VALUES ("19", "105", "8");
INSERT INTO "Student_Enrolment" VALUES ("20", "105", "9");
INSERT INTO "Student_Enrolment" VALUES ("21", "105", "10");
INSERT INTO "Student_Enrolment" VALUES ("22", "101", "6");
INSERT INTO "Student_Enrolment" VALUES ("23", "101", "7");
INSERT INTO "Student_Enrolment" VALUES ("24", "102", "8");
INSERT INTO "Student_Enrolment" VALUES ("25", "102", "9");
INSERT INTO "Student_Enrolment" VALUES ("26", "102", "10");