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,
PRIMARY KEY ("course_id")
);

CREATE TABLE "Sections" (
"section_id" INT,
"course_id" INT,
PRIMARY KEY ("section_id"),
FOREIGN KEY ("course_id") REFERENCES "Courses"("course_id")
);

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





INSERT INTO "Courses" VALUES ("101");
INSERT INTO "Courses" VALUES ("102");
INSERT INTO "Courses" VALUES ("103");
INSERT INTO "Courses" VALUES ("104");
INSERT INTO "Courses" VALUES ("105");
INSERT INTO "Courses" VALUES ("106");
INSERT INTO "Courses" VALUES ("107");
INSERT INTO "Sections" VALUES ("1", "101");
INSERT INTO "Sections" VALUES ("2", "101");
INSERT INTO "Sections" VALUES ("3", "102");
INSERT INTO "Sections" VALUES ("4", "103");
INSERT INTO "Sections" VALUES ("5", "104");
INSERT INTO "Sections" VALUES ("6", "105");
INSERT INTO "Sections" VALUES ("7", "106");
INSERT INTO "Sections" VALUES ("8", "107");
INSERT INTO "Sections" VALUES ("9", "107");
INSERT INTO "Student_Enrolment_Courses" VALUES ("1001", "101");
INSERT INTO "Student_Enrolment_Courses" VALUES ("1002", "102");
INSERT INTO "Student_Enrolment_Courses" VALUES ("1003", "103");
INSERT INTO "Student_Enrolment_Courses" VALUES ("1004", "101");
INSERT INTO "Student_Enrolment_Courses" VALUES ("1005", "104");
INSERT INTO "Student_Enrolment_Courses" VALUES ("1006", "105");
INSERT INTO "Student_Enrolment_Courses" VALUES ("1007", "106");
INSERT INTO "Student_Enrolment_Courses" VALUES ("1008", "107");
INSERT INTO "Student_Enrolment_Courses" VALUES ("1009", "102");