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,
"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", "Introduction to Psychology");
INSERT INTO "Courses" VALUES ("102", "Calculus I");
INSERT INTO "Courses" VALUES ("103", "World History");
INSERT INTO "Courses" VALUES ("104", "Organic Chemistry");
INSERT INTO "Courses" VALUES ("105", "Computer Science Fundamentals");
INSERT INTO "Courses" VALUES ("106", "English Literature");
INSERT INTO "Courses" VALUES ("107", "Microeconomics");
INSERT INTO "Courses" VALUES ("108", "Art History");
INSERT INTO "Courses" VALUES ("109", "Physics I");
INSERT INTO "Courses" VALUES ("110", "Philosophy of Science");
INSERT INTO "Sections" VALUES ("201", "101");
INSERT INTO "Sections" VALUES ("202", "101");
INSERT INTO "Sections" VALUES ("203", "102");
INSERT INTO "Sections" VALUES ("204", "103");
INSERT INTO "Sections" VALUES ("205", "104");
INSERT INTO "Sections" VALUES ("206", "105");
INSERT INTO "Sections" VALUES ("207", "106");
INSERT INTO "Sections" VALUES ("208", "107");
INSERT INTO "Sections" VALUES ("209", "108");
INSERT INTO "Sections" VALUES ("210", "109");
INSERT INTO "Sections" VALUES ("211", "110");
INSERT INTO "Student_Enrolment_Courses" VALUES ("301", "101");
INSERT INTO "Student_Enrolment_Courses" VALUES ("302", "102");
INSERT INTO "Student_Enrolment_Courses" VALUES ("303", "103");
INSERT INTO "Student_Enrolment_Courses" VALUES ("304", "104");
INSERT INTO "Student_Enrolment_Courses" VALUES ("305", "105");
INSERT INTO "Student_Enrolment_Courses" VALUES ("306", "106");
INSERT INTO "Student_Enrolment_Courses" VALUES ("307", "107");
INSERT INTO "Student_Enrolment_Courses" VALUES ("308", "108");
INSERT INTO "Student_Enrolment_Courses" VALUES ("309", "109");
INSERT INTO "Student_Enrolment_Courses" VALUES ("310", "110");
INSERT INTO "Student_Enrolment_Courses" VALUES ("311", "101");
INSERT INTO "Student_Enrolment_Courses" VALUES ("312", "102");