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

CREATE TABLE "Semesters" (
"semester_id" INT,
"semester_name" VARCHAR(255),
PRIMARY KEY ("semester_id")
);





INSERT INTO "Courses" VALUES ("1", "Introduction to Programming");
INSERT INTO "Courses" VALUES ("2", "Data Structures");
INSERT INTO "Courses" VALUES ("3", "Algorithms");
INSERT INTO "Courses" VALUES ("4", "Database Systems");
INSERT INTO "Courses" VALUES ("5", "Operating Systems");
INSERT INTO "Courses" VALUES ("6", "Calculus I");
INSERT INTO "Courses" VALUES ("7", "Linear Algebra");
INSERT INTO "Courses" VALUES ("8", "Discrete Mathematics");
INSERT INTO "Courses" VALUES ("9", "Introduction to Psychology");
INSERT INTO "Courses" VALUES ("10", "Microeconomics");
INSERT INTO "Departments" VALUES ("101", "Computer Science");
INSERT INTO "Departments" VALUES ("102", "Mathematics");
INSERT INTO "Departments" VALUES ("103", "Psychology");
INSERT INTO "Departments" VALUES ("104", "Economics");
INSERT INTO "Departments" VALUES ("105", "Physics");
INSERT INTO "Departments" VALUES ("106", "Biology");
INSERT INTO "Degree_Programs" VALUES ("1001", "101");
INSERT INTO "Degree_Programs" VALUES ("1002", "101");
INSERT INTO "Degree_Programs" VALUES ("1003", "101");
INSERT INTO "Degree_Programs" VALUES ("1004", "102");
INSERT INTO "Degree_Programs" VALUES ("1005", "102");
INSERT INTO "Degree_Programs" VALUES ("1006", "103");
INSERT INTO "Degree_Programs" VALUES ("1007", "101");
INSERT INTO "Degree_Programs" VALUES ("1008", "104");
INSERT INTO "Degree_Programs" VALUES ("1009", "101");
INSERT INTO "Degree_Programs" VALUES ("1010", "103");
INSERT INTO "Degree_Programs" VALUES ("1011", "101");
INSERT INTO "Degree_Programs" VALUES ("1012", "102");
INSERT INTO "Degree_Programs" VALUES ("1013", "105");
INSERT INTO "Degree_Programs" VALUES ("1014", "106");
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 "Semesters" VALUES ("1", "Fall 2023");
INSERT INTO "Semesters" VALUES ("2", "Spring 2024");
INSERT INTO "Semesters" VALUES ("3", "Summer 2024");
INSERT INTO "Semesters" VALUES ("4", "Fall 2024");
INSERT INTO "Semesters" VALUES ("5", "Spring 2025");