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 "Departments" (
"department_id" INT,
"department_name" VARCHAR(255),
PRIMARY KEY ("department_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),
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 "Degree_Programs" VALUES ("5", "Biology");
INSERT INTO "Departments" VALUES ("1", "Engineering");
INSERT INTO "Departments" VALUES ("2", "Science");
INSERT INTO "Departments" VALUES ("3", "Business");
INSERT INTO "Departments" VALUES ("4", "Arts");
INSERT INTO "Students" VALUES ("101", "Alice");
INSERT INTO "Students" VALUES ("102", "Bob");
INSERT INTO "Students" VALUES ("103", "Charlie");
INSERT INTO "Students" VALUES ("104", "Diana");
INSERT INTO "Students" VALUES ("105", "Ethan");
INSERT INTO "Students" VALUES ("106", "Fiona");
INSERT INTO "Students" VALUES ("107", "George");
INSERT INTO "Students" VALUES ("108", "Hannah");
INSERT INTO "Students" VALUES ("109", "Ian");
INSERT INTO "Students" VALUES ("110", "Jane");
INSERT INTO "Students" VALUES ("111", "Kevin");
INSERT INTO "Students" VALUES ("112", "Laura");
INSERT INTO "Students" VALUES ("113", "Mike");
INSERT INTO "Students" VALUES ("114", "Nina");
INSERT INTO "Students" VALUES ("115", "Oscar");
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", "1", "104");
INSERT INTO "Student_Enrolment" VALUES ("5", "1", "105");
INSERT INTO "Student_Enrolment" VALUES ("6", "2", "106");
INSERT INTO "Student_Enrolment" VALUES ("7", "2", "107");
INSERT INTO "Student_Enrolment" VALUES ("8", "3", "108");
INSERT INTO "Student_Enrolment" VALUES ("9", "3", "109");
INSERT INTO "Student_Enrolment" VALUES ("10", "3", "110");
INSERT INTO "Student_Enrolment" VALUES ("11", "4", "111");
INSERT INTO "Student_Enrolment" VALUES ("12", "4", "112");
INSERT INTO "Student_Enrolment" VALUES ("13", "5", "113");
INSERT INTO "Student_Enrolment" VALUES ("14", "5", "114");
INSERT INTO "Student_Enrolment" VALUES ("15", "5", "115");
INSERT INTO "Student_Enrolment" VALUES ("16", "1", "106");
INSERT INTO "Student_Enrolment" VALUES ("17", "1", "107");