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 ("101", "Introduction to Programming");
INSERT INTO "Courses" VALUES ("102", "Data Structures");
INSERT INTO "Courses" VALUES ("103", "Calculus I");
INSERT INTO "Courses" VALUES ("104", "Linear Algebra");
INSERT INTO "Courses" VALUES ("105", "Database Systems");
INSERT INTO "Courses" VALUES ("106", "Operating Systems");
INSERT INTO "Courses" VALUES ("107", "Art History I");
INSERT INTO "Courses" VALUES ("108", "Introduction to Psychology");
INSERT INTO "Courses" VALUES ("109", "Microeconomics");
INSERT INTO "Courses" VALUES ("110", "Macroeconomics");
INSERT INTO "Departments" VALUES ("1", "Computer Science");
INSERT INTO "Departments" VALUES ("2", "Mathematics");
INSERT INTO "Departments" VALUES ("3", "Arts and Humanities");
INSERT INTO "Departments" VALUES ("4", "Social Sciences");
INSERT INTO "Departments" VALUES ("5", "Engineering");
INSERT INTO "Departments" VALUES ("6", "Business");
INSERT INTO "Departments" VALUES ("7", "Physics");
INSERT INTO "Degree_Programs" VALUES ("901", "1", "Bachelor of Science in Computer Science");
INSERT INTO "Degree_Programs" VALUES ("902", "1", "Master of Science in Computer Science");
INSERT INTO "Degree_Programs" VALUES ("903", "2", "Bachelor of Science in Mathematics");
INSERT INTO "Degree_Programs" VALUES ("904", "2", "Master of Science in Applied Mathematics");
INSERT INTO "Degree_Programs" VALUES ("905", "3", "Bachelor of Arts in Art History");
INSERT INTO "Degree_Programs" VALUES ("906", "4", "Bachelor of Arts in Psychology");
INSERT INTO "Degree_Programs" VALUES ("907", "4", "Master of Arts in Economics");
INSERT INTO "Degree_Programs" VALUES ("908", "5", "Bachelor of Science in Electrical Engineering");
INSERT INTO "Degree_Programs" VALUES ("909", "6", "Master of Business Administration");
INSERT INTO "Degree_Programs" VALUES ("910", "7", "Bachelor of Science in Physics");
INSERT INTO "Degree_Programs" VALUES ("911", "1", "Ph.D. in Computer Science");
INSERT INTO "Degree_Programs" VALUES ("912", "2", "Ph.D. in Pure Mathematics");
INSERT INTO "Degree_Programs" VALUES ("913", "3", "Master of Arts in Literature");
INSERT INTO "Degree_Programs" VALUES ("914", "4", "Ph.D. in Sociology");
INSERT INTO "Degree_Programs" VALUES ("915", "5", "Master of Science in Mechanical Engineering");
INSERT INTO "Degree_Programs" VALUES ("916", "6", "Bachelor of Business Administration");
INSERT INTO "Degree_Programs" VALUES ("917", "7", "Master of Science in Astrophysics");
INSERT INTO "Sections" VALUES ("2001", "101");
INSERT INTO "Sections" VALUES ("2002", "102");
INSERT INTO "Sections" VALUES ("2003", "103");
INSERT INTO "Sections" VALUES ("2004", "104");
INSERT INTO "Sections" VALUES ("2005", "105");
INSERT INTO "Sections" VALUES ("2006", "106");
INSERT INTO "Sections" VALUES ("2007", "107");
INSERT INTO "Sections" VALUES ("2008", "108");
INSERT INTO "Sections" VALUES ("2009", "109");
INSERT INTO "Sections" VALUES ("2010", "110");
INSERT INTO "Sections" VALUES ("2011", "101");
INSERT INTO "Sections" VALUES ("2012", "103");
INSERT INTO "Student_Enrolment" VALUES ("3001", "901");
INSERT INTO "Student_Enrolment" VALUES ("3002", "901");
INSERT INTO "Student_Enrolment" VALUES ("3003", "903");
INSERT INTO "Student_Enrolment" VALUES ("3004", "905");
INSERT INTO "Student_Enrolment" VALUES ("3005", "906");
INSERT INTO "Student_Enrolment" VALUES ("3006", "902");
INSERT INTO "Student_Enrolment" VALUES ("3007", "907");
INSERT INTO "Student_Enrolment" VALUES ("3008", "908");
INSERT INTO "Student_Enrolment" VALUES ("3009", "909");
INSERT INTO "Student_Enrolment" VALUES ("3010", "910");
INSERT INTO "Student_Enrolment" VALUES ("3011", "901");
INSERT INTO "Student_Enrolment" VALUES ("3012", "903");
INSERT INTO "Student_Enrolment" VALUES ("3013", "911");
INSERT INTO "Student_Enrolment" VALUES ("3014", "912");
INSERT INTO "Student_Enrolment" VALUES ("3015", "913");
INSERT INTO "Student_Enrolment" VALUES ("3016", "914");
INSERT INTO "Student_Enrolment" VALUES ("3017", "915");
INSERT INTO "Student_Enrolment" VALUES ("3018", "916");
INSERT INTO "Student_Enrolment" VALUES ("3019", "917");