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 "Courses" (
"course_id" INT UNIQUE,
"course_name" VARCHAR(255),
PRIMARY KEY ("course_id")
);

CREATE TABLE "Sections" (
"section_id" INT,
"section_name" VARCHAR(255),
PRIMARY KEY ("section_id")
);

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

CREATE TABLE "Student_Enrolment" (
"student_enrolment_id" INT UNIQUE,
"student_id" INT,
PRIMARY KEY ("student_enrolment_id")
);

CREATE TABLE "Student_Enrolment_Courses" (
"student_course_id" INT,
"course_id" INT,
"student_enrolment_id" INT,
PRIMARY KEY ("student_course_id"),
FOREIGN KEY ("student_enrolment_id") REFERENCES "Student_Enrolment"("student_enrolment_id"),
FOREIGN KEY ("course_id") REFERENCES "Courses"("course_id")
);





INSERT INTO "Courses" VALUES ("1", "Mathematics");
INSERT INTO "Courses" VALUES ("2", "Physics");
INSERT INTO "Courses" VALUES ("3", "Chemistry");
INSERT INTO "Courses" VALUES ("4", "Biology");
INSERT INTO "Courses" VALUES ("5", "Computer Science");
INSERT INTO "Courses" VALUES ("6", "History");
INSERT INTO "Courses" VALUES ("7", "Literature");
INSERT INTO "Sections" VALUES ("1", "Section A");
INSERT INTO "Sections" VALUES ("2", "Section B");
INSERT INTO "Sections" VALUES ("3", "Section C");
INSERT INTO "Semesters" VALUES ("1", "Fall 2023");
INSERT INTO "Semesters" VALUES ("2", "Spring 2024");
INSERT INTO "Student_Enrolment" VALUES ("1", "101");
INSERT INTO "Student_Enrolment" VALUES ("2", "102");
INSERT INTO "Student_Enrolment" VALUES ("3", "103");
INSERT INTO "Student_Enrolment" VALUES ("4", "104");
INSERT INTO "Student_Enrolment" VALUES ("5", "105");
INSERT INTO "Student_Enrolment" VALUES ("6", "106");
INSERT INTO "Student_Enrolment" VALUES ("7", "107");
INSERT INTO "Student_Enrolment" VALUES ("8", "108");
INSERT INTO "Student_Enrolment" VALUES ("9", "109");
INSERT INTO "Student_Enrolment" VALUES ("10", "110");
INSERT INTO "Student_Enrolment" VALUES ("11", "111");
INSERT INTO "Student_Enrolment" VALUES ("12", "112");
INSERT INTO "Student_Enrolment" VALUES ("13", "113");
INSERT INTO "Student_Enrolment" VALUES ("14", "114");
INSERT INTO "Student_Enrolment" VALUES ("15", "115");
INSERT INTO "Student_Enrolment" VALUES ("16", "116");
INSERT INTO "Student_Enrolment" VALUES ("17", "117");
INSERT INTO "Student_Enrolment" VALUES ("18", "118");
INSERT INTO "Student_Enrolment" VALUES ("19", "119");
INSERT INTO "Student_Enrolment" VALUES ("20", "120");
INSERT INTO "Student_Enrolment_Courses" VALUES ("1", "1", "1");
INSERT INTO "Student_Enrolment_Courses" VALUES ("2", "1", "2");
INSERT INTO "Student_Enrolment_Courses" VALUES ("3", "1", "3");
INSERT INTO "Student_Enrolment_Courses" VALUES ("4", "1", "4");
INSERT INTO "Student_Enrolment_Courses" VALUES ("5", "1", "5");
INSERT INTO "Student_Enrolment_Courses" VALUES ("6", "1", "6");
INSERT INTO "Student_Enrolment_Courses" VALUES ("7", "1", "7");
INSERT INTO "Student_Enrolment_Courses" VALUES ("8", "1", "8");
INSERT INTO "Student_Enrolment_Courses" VALUES ("9", "1", "9");
INSERT INTO "Student_Enrolment_Courses" VALUES ("10", "1", "10");
INSERT INTO "Student_Enrolment_Courses" VALUES ("11", "2", "11");
INSERT INTO "Student_Enrolment_Courses" VALUES ("12", "2", "12");
INSERT INTO "Student_Enrolment_Courses" VALUES ("13", "2", "13");
INSERT INTO "Student_Enrolment_Courses" VALUES ("14", "2", "14");
INSERT INTO "Student_Enrolment_Courses" VALUES ("15", "2", "15");
INSERT INTO "Student_Enrolment_Courses" VALUES ("16", "3", "16");
INSERT INTO "Student_Enrolment_Courses" VALUES ("17", "3", "17");
INSERT INTO "Student_Enrolment_Courses" VALUES ("18", "3", "18");
INSERT INTO "Student_Enrolment_Courses" VALUES ("19", "4", "19");
INSERT INTO "Student_Enrolment_Courses" VALUES ("20", "5", "20");
INSERT INTO "Student_Enrolment_Courses" VALUES ("21", "1", "11");
INSERT INTO "Student_Enrolment_Courses" VALUES ("22", "1", "12");
INSERT INTO "Student_Enrolment_Courses" VALUES ("23", "1", "13");
INSERT INTO "Student_Enrolment_Courses" VALUES ("24", "1", "14");
INSERT INTO "Student_Enrolment_Courses" VALUES ("25", "1", "15");
INSERT INTO "Student_Enrolment_Courses" VALUES ("26", "1", "16");
INSERT INTO "Student_Enrolment_Courses" VALUES ("27", "1", "17");
INSERT INTO "Student_Enrolment_Courses" VALUES ("28", "1", "18");
INSERT INTO "Student_Enrolment_Courses" VALUES ("29", "1", "19");
INSERT INTO "Student_Enrolment_Courses" VALUES ("30", "1", "20");