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

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

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





INSERT INTO "Courses" VALUES ("101", "Introduction to Biology", "Basic concepts of biology including cell structure and genetics");
INSERT INTO "Courses" VALUES ("102", "Advanced Mathematics", "In-depth study of calculus and linear algebra");
INSERT INTO "Courses" VALUES ("103", "World History", "Overview of major world events from ancient to modern times");
INSERT INTO "Courses" VALUES ("104", "Creative Writing", "Techniques and practice of creative writing");
INSERT INTO "Courses" VALUES ("105", "Physics I", "Fundamentals of mechanics and thermodynamics");
INSERT INTO "Courses" VALUES ("106", "Philosophy", "Introduction to philosophical thinking and major philosophers");
INSERT INTO "Courses" VALUES ("107", "Art Appreciation", "Study of visual arts and their cultural significance");
INSERT INTO "Sections" VALUES ("201", "101", "Biology - Section A");
INSERT INTO "Sections" VALUES ("202", "101", "Biology - Section B");
INSERT INTO "Sections" VALUES ("203", "102", "Math - Section A");
INSERT INTO "Sections" VALUES ("204", "103", "History - Section A");
INSERT INTO "Sections" VALUES ("205", "103", "History - Section B");
INSERT INTO "Sections" VALUES ("206", "103", "History - Section C");
INSERT INTO "Sections" VALUES ("207", "105", "Physics - Section A");
INSERT INTO "Sections" VALUES ("208", "105", "Physics - Section B");
INSERT INTO "Sections" VALUES ("209", "105", "Physics - Section C");
INSERT INTO "Sections" VALUES ("210", "105", "Physics - Section D");
INSERT INTO "Student_Enrolment" VALUES ("301", "1");
INSERT INTO "Student_Enrolment" VALUES ("302", "1");
INSERT INTO "Student_Enrolment" VALUES ("303", "2");
INSERT INTO "Student_Enrolment" VALUES ("304", "2");
INSERT INTO "Student_Enrolment" VALUES ("305", "3");
INSERT INTO "Student_Enrolment" VALUES ("306", "3");
INSERT INTO "Student_Enrolment" VALUES ("307", "4");
INSERT INTO "Student_Enrolment" VALUES ("308", "4");
INSERT INTO "Student_Enrolment" VALUES ("309", "5");
INSERT INTO "Student_Enrolment" VALUES ("310", "5");