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

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

CREATE TABLE "Students" (
"student_id" INT,
"first_name" VARCHAR(80),
"last_name" VARCHAR(40),
PRIMARY KEY ("student_id")
);





INSERT INTO "Courses" VALUES ("101", "Introduction to Programming");
INSERT INTO "Courses" VALUES ("102", "Database Management");
INSERT INTO "Courses" VALUES ("103", "Web Development Basics");
INSERT INTO "Courses" VALUES ("104", "Data Structures and Algorithms");
INSERT INTO "Courses" VALUES ("105", "Operating Systems");
INSERT INTO "Courses" VALUES ("106", "Calculus I");
INSERT INTO "Courses" VALUES ("107", "Linear Algebra");
INSERT INTO "Courses" VALUES ("108", "Discrete Mathematics");
INSERT INTO "Sections" VALUES ("1", "Fall 2023 - Section A");
INSERT INTO "Sections" VALUES ("2", "Fall 2023 - Section B");
INSERT INTO "Sections" VALUES ("3", "Spring 2024 - Section A");
INSERT INTO "Sections" VALUES ("4", "Spring 2024 - Section B");
INSERT INTO "Sections" VALUES ("5", "Summer 2024 - Section A");
INSERT INTO "Students" VALUES ("1", "Alice", "Smith");
INSERT INTO "Students" VALUES ("2", "Bob", "Johnson");
INSERT INTO "Students" VALUES ("3", "Charlie", "Brown");
INSERT INTO "Students" VALUES ("4", "Diana", "Prince");
INSERT INTO "Students" VALUES ("5", "Eve", "Adams");
INSERT INTO "Students" VALUES ("6", "Frank", "White");
INSERT INTO "Students" VALUES ("7", "Grace", "Taylor");
INSERT INTO "Students" VALUES ("8", "Henry", "Miller");
INSERT INTO "Students" VALUES ("9", "Ivy", "Davis");
INSERT INTO "Students" VALUES ("10", "Jack", "Wilson");
INSERT INTO "Student_Enrolment_Courses" VALUES ("1", "101", "1");
INSERT INTO "Student_Enrolment_Courses" VALUES ("2", "101", "2");
INSERT INTO "Student_Enrolment_Courses" VALUES ("3", "101", "3");
INSERT INTO "Student_Enrolment_Courses" VALUES ("4", "101", "4");
INSERT INTO "Student_Enrolment_Courses" VALUES ("5", "101", "5");
INSERT INTO "Student_Enrolment_Courses" VALUES ("6", "101", "6");
INSERT INTO "Student_Enrolment_Courses" VALUES ("7", "102", "1");
INSERT INTO "Student_Enrolment_Courses" VALUES ("8", "102", "2");
INSERT INTO "Student_Enrolment_Courses" VALUES ("9", "102", "3");
INSERT INTO "Student_Enrolment_Courses" VALUES ("10", "102", "7");
INSERT INTO "Student_Enrolment_Courses" VALUES ("11", "103", "4");
INSERT INTO "Student_Enrolment_Courses" VALUES ("12", "103", "5");
INSERT INTO "Student_Enrolment_Courses" VALUES ("13", "103", "8");
INSERT INTO "Student_Enrolment_Courses" VALUES ("14", "104", "1");
INSERT INTO "Student_Enrolment_Courses" VALUES ("15", "104", "9");
INSERT INTO "Student_Enrolment_Courses" VALUES ("16", "105", "10");
INSERT INTO "Student_Enrolment_Courses" VALUES ("17", "106", "1");
INSERT INTO "Student_Enrolment_Courses" VALUES ("18", "106", "2");
INSERT INTO "Student_Enrolment_Courses" VALUES ("19", "106", "3");
INSERT INTO "Student_Enrolment_Courses" VALUES ("20", "107", "4");
INSERT INTO "Student_Enrolment_Courses" VALUES ("21", "107", "5");
INSERT INTO "Student_Enrolment_Courses" VALUES ("22", "108", "6");
INSERT INTO "Student_Enrolment_Courses" VALUES ("23", "108", "7");
INSERT INTO "Student_Enrolment_Courses" VALUES ("24", "108", "8");
INSERT INTO "Student_Enrolment_Courses" VALUES ("25", "108", "9");
INSERT INTO "Student_Enrolment_Courses" VALUES ("26", "108", "10");
INSERT INTO "Student_Enrolment_Courses" VALUES ("27", "101", "7");
INSERT INTO "Student_Enrolment_Courses" VALUES ("28", "101", "8");
INSERT INTO "Student_Enrolment_Courses" VALUES ("29", "101", "9");
INSERT INTO "Student_Enrolment_Courses" VALUES ("30", "101", "10");
INSERT INTO "Student_Enrolment_Courses" VALUES ("31", "102", "4");
INSERT INTO "Student_Enrolment_Courses" VALUES ("32", "102", "5");
INSERT INTO "Student_Enrolment_Courses" VALUES ("33", "102", "6");
INSERT INTO "Student_Enrolment_Courses" VALUES ("34", "103", "1");
INSERT INTO "Student_Enrolment_Courses" VALUES ("35", "103", "2");
INSERT INTO "Student_Enrolment_Courses" VALUES ("36", "103", "3");
INSERT INTO "Student_Enrolment_Courses" VALUES ("37", "104", "2");
INSERT INTO "Student_Enrolment_Courses" VALUES ("38", "104", "3");
INSERT INTO "Student_Enrolment_Courses" VALUES ("39", "104", "4");
INSERT INTO "Student_Enrolment_Courses" VALUES ("40", "104", "5");
INSERT INTO "Student_Enrolment_Courses" VALUES ("41", "104", "6");
INSERT INTO "Student_Enrolment_Courses" VALUES ("42", "104", "7");
INSERT INTO "Student_Enrolment_Courses" VALUES ("43", "104", "8");
INSERT INTO "Student_Enrolment_Courses" VALUES ("44", "104", "10");