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", "Mathematics", "Basic math concepts and problem solving");
INSERT INTO "Courses" VALUES ("102", "Physics", "Introduction to classical mechanics");
INSERT INTO "Courses" VALUES ("103", "Chemistry", "Fundamentals of chemical reactions");
INSERT INTO "Courses" VALUES ("104", "Literature", "Study of classic and modern literature");
INSERT INTO "Courses" VALUES ("105", "Computer Science", "Programming and algorithms");
INSERT INTO "Courses" VALUES ("106", "History", "World history overview");
INSERT INTO "Courses" VALUES ("107", "Art", "Art history and techniques");
INSERT INTO "Sections" VALUES ("201", "101", "Algebra");
INSERT INTO "Sections" VALUES ("202", "101", "Geometry");
INSERT INTO "Sections" VALUES ("203", "102", "Mechanics");
INSERT INTO "Sections" VALUES ("204", "102", "Thermodynamics");
INSERT INTO "Sections" VALUES ("205", "102", "Optics");
INSERT INTO "Sections" VALUES ("206", "103", "Organic Chemistry");
INSERT INTO "Sections" VALUES ("207", "104", "Poetry");
INSERT INTO "Sections" VALUES ("208", "104", "Novels");
INSERT INTO "Sections" VALUES ("209", "105", "Intro to Programming");
INSERT INTO "Sections" VALUES ("210", "106", "Ancient Civilizations");
INSERT INTO "Student_Enrolment_Courses" VALUES ("301", "4001");
INSERT INTO "Student_Enrolment_Courses" VALUES ("302", "4002");
INSERT INTO "Student_Enrolment_Courses" VALUES ("303", "4003");
INSERT INTO "Student_Enrolment_Courses" VALUES ("304", "4004");
INSERT INTO "Student_Enrolment_Courses" VALUES ("305", "4005");
INSERT INTO "Student_Enrolment_Courses" VALUES ("306", "4006");
INSERT INTO "Student_Enrolment_Courses" VALUES ("307", "4007");