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

CREATE TABLE "Degree_Programs" (
"degree_program_id" INT UNIQUE,
"department_id" INT,
"degree_summary_name" VARCHAR(255),
PRIMARY KEY ("degree_program_id"),
FOREIGN KEY ("department_id") REFERENCES "Departments"("department_id")
);

CREATE TABLE "Departments" (
"department_id" INT UNIQUE,
"department_name" VARCHAR(255),
PRIMARY KEY ("department_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" (
"student_enrolment_id" INT,
"degree_program_id" INT,
PRIMARY KEY ("student_enrolment_id"),
FOREIGN KEY ("degree_program_id") REFERENCES "Degree_Programs"("degree_program_id")
);





INSERT INTO "Courses" VALUES ("1", "Introduction to Programming");
INSERT INTO "Courses" VALUES ("2", "Data Structures");
INSERT INTO "Courses" VALUES ("3", "Calculus I");
INSERT INTO "Courses" VALUES ("4", "Linear Algebra");
INSERT INTO "Courses" VALUES ("5", "Organic Chemistry");
INSERT INTO "Courses" VALUES ("6", "Thermodynamics");
INSERT INTO "Courses" VALUES ("7", "Microeconomics");
INSERT INTO "Courses" VALUES ("8", "Macroeconomics");
INSERT INTO "Courses" VALUES ("9", "Art History I");
INSERT INTO "Courses" VALUES ("10", "World Literature");
INSERT INTO "Departments" VALUES ("1", "Computer Science");
INSERT INTO "Departments" VALUES ("2", "Mathematics");
INSERT INTO "Departments" VALUES ("3", "Chemistry");
INSERT INTO "Departments" VALUES ("4", "Physics");
INSERT INTO "Departments" VALUES ("5", "Economics");
INSERT INTO "Departments" VALUES ("6", "Arts and Humanities");
INSERT INTO "Departments" VALUES ("7", "Biology");
INSERT INTO "Departments" VALUES ("8", "Engineering");
INSERT INTO "Degree_Programs" VALUES ("101", "1", "Bachelor of Science in Computer Science");
INSERT INTO "Degree_Programs" VALUES ("102", "1", "Master of Science in Computer Science");
INSERT INTO "Degree_Programs" VALUES ("201", "2", "Bachelor of Science in Mathematics");
INSERT INTO "Degree_Programs" VALUES ("202", "2", "Master of Science in Applied Mathematics");
INSERT INTO "Degree_Programs" VALUES ("301", "3", "Bachelor of Science in Chemistry");
INSERT INTO "Degree_Programs" VALUES ("401", "4", "Bachelor of Science in Physics");
INSERT INTO "Degree_Programs" VALUES ("501", "5", "Bachelor of Arts in Economics");
INSERT INTO "Degree_Programs" VALUES ("601", "6", "Bachelor of Arts in Art History");
INSERT INTO "Degree_Programs" VALUES ("602", "6", "Master of Arts in Literature");
INSERT INTO "Degree_Programs" VALUES ("701", "7", "Bachelor of Science in Biology");
INSERT INTO "Degree_Programs" VALUES ("801", "8", "Bachelor of Science in Mechanical Engineering");
INSERT INTO "Degree_Programs" VALUES ("802", "8", "Master of Engineering in Electrical Engineering");
INSERT INTO "Degree_Programs" VALUES ("901", "NULL", "Undeclared Major");
INSERT INTO "Sections" VALUES ("1001", "1");
INSERT INTO "Sections" VALUES ("1002", "2");
INSERT INTO "Sections" VALUES ("1003", "3");
INSERT INTO "Sections" VALUES ("1004", "4");
INSERT INTO "Sections" VALUES ("1005", "5");
INSERT INTO "Sections" VALUES ("1006", "6");
INSERT INTO "Sections" VALUES ("1007", "7");
INSERT INTO "Sections" VALUES ("1008", "8");
INSERT INTO "Sections" VALUES ("1009", "9");
INSERT INTO "Sections" VALUES ("1010", "10");
INSERT INTO "Student_Enrolment" VALUES ("1", "101");
INSERT INTO "Student_Enrolment" VALUES ("2", "101");
INSERT INTO "Student_Enrolment" VALUES ("3", "201");
INSERT INTO "Student_Enrolment" VALUES ("4", "301");
INSERT INTO "Student_Enrolment" VALUES ("5", "501");
INSERT INTO "Student_Enrolment" VALUES ("6", "601");
INSERT INTO "Student_Enrolment" VALUES ("7", "102");
INSERT INTO "Student_Enrolment" VALUES ("8", "202");
INSERT INTO "Student_Enrolment" VALUES ("9", "801");
INSERT INTO "Student_Enrolment" VALUES ("10", "901");