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 ("1", "Computer Science");
INSERT INTO "Departments" VALUES ("2", "Mathematics");
INSERT INTO "Departments" VALUES ("3", "Psychology");
INSERT INTO "Departments" VALUES ("4", "Economics");
INSERT INTO "Departments" VALUES ("5", "Physics");
INSERT INTO "Departments" VALUES ("6", "Chemistry");
INSERT INTO "Departments" VALUES ("7", "Biology");
INSERT INTO "Departments" VALUES ("8", "History");
INSERT INTO "Degree_Programs" VALUES ("101", "1");
INSERT INTO "Degree_Programs" VALUES ("102", "1");
INSERT INTO "Degree_Programs" VALUES ("103", "2");
INSERT INTO "Degree_Programs" VALUES ("104", "3");
INSERT INTO "Degree_Programs" VALUES ("105", "4");
INSERT INTO "Degree_Programs" VALUES ("106", "1");
INSERT INTO "Degree_Programs" VALUES ("107", "2");
INSERT INTO "Degree_Programs" VALUES ("108", "3");
INSERT INTO "Degree_Programs" VALUES ("109", "4");
INSERT INTO "Degree_Programs" VALUES ("110", "5");
INSERT INTO "Sections" VALUES ("1001", "Fall 2023 - Section A");
INSERT INTO "Sections" VALUES ("1002", "Fall 2023 - Section B");
INSERT INTO "Sections" VALUES ("1003", "Spring 2024 - Section A");
INSERT INTO "Sections" VALUES ("1004", "Spring 2024 - Section B");
INSERT INTO "Sections" VALUES ("1005", "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");