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_Courses" (
"student_course_id" INT,
"student_enrolment_id" INT,
PRIMARY KEY ("student_course_id")
);





INSERT INTO "Courses" VALUES ("101", "Calculus I", "Introduction to differential calculus");
INSERT INTO "Courses" VALUES ("102", "Physics I", "Mechanics and waves");
INSERT INTO "Courses" VALUES ("103", "Literature", "Study of classic and modern literature");
INSERT INTO "Courses" VALUES ("104", "Art History", "Overview of art movements");
INSERT INTO "Courses" VALUES ("105", "Computer Science", "Introduction to programming");
INSERT INTO "Courses" VALUES ("106", "Philosophy", "Introduction to philosophy");
INSERT INTO "Courses" VALUES ("107", "Biology", "General biology concepts");
INSERT INTO "Courses" VALUES ("108", "Chemistry", "Basic chemistry principles");
INSERT INTO "Courses" VALUES ("109", "Economics", "Micro and macroeconomics");
INSERT INTO "Courses" VALUES ("110", "Sociology", "Foundations of sociology");
INSERT INTO "Sections" VALUES ("201", "101", "Calculus I - Section A");
INSERT INTO "Sections" VALUES ("202", "101", "Calculus I - Section B");
INSERT INTO "Sections" VALUES ("203", "102", "Physics I - Section A");
INSERT INTO "Sections" VALUES ("204", "103", "Literature - Section A");
INSERT INTO "Sections" VALUES ("205", "103", "Literature - Section B");
INSERT INTO "Sections" VALUES ("206", "103", "Literature - Section C");
INSERT INTO "Sections" VALUES ("207", "105", "Computer Science - Section A");
INSERT INTO "Sections" VALUES ("208", "105", "Computer Science - Section B");
INSERT INTO "Sections" VALUES ("209", "106", "Philosophy - Section A");
INSERT INTO "Sections" VALUES ("210", "107", "Biology - Section A");
INSERT INTO "Sections" VALUES ("211", "107", "Biology - Section B");
INSERT INTO "Sections" VALUES ("212", "108", "Chemistry - Section A");
INSERT INTO "Sections" VALUES ("213", "109", "Economics - Section A");
INSERT INTO "Sections" VALUES ("214", "109", "Economics - Section B");
INSERT INTO "Student_Enrolment_Courses" VALUES ("1", "1001");
INSERT INTO "Student_Enrolment_Courses" VALUES ("2", "1002");
INSERT INTO "Student_Enrolment_Courses" VALUES ("3", "1003");
INSERT INTO "Student_Enrolment_Courses" VALUES ("4", "1004");
INSERT INTO "Student_Enrolment_Courses" VALUES ("5", "1005");