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 "Student_Enrolment" (
"student_enrolment_id" INT,
"degree_program_id" INT,
"semester_id" INT,
PRIMARY KEY ("student_enrolment_id")
);

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

CREATE TABLE "Transcript_Contents" (
"student_course_id" INT,
"transcript_id" INT,
FOREIGN KEY ("transcript_id") REFERENCES "Transcripts"("transcript_id"),
FOREIGN KEY ("student_course_id") REFERENCES "Student_Enrolment_Courses"("student_course_id")
);

CREATE TABLE "Transcripts" (
"transcript_id" INT UNIQUE,
"transcript_date" DATETIME,
PRIMARY KEY ("transcript_id")
);





INSERT INTO "Courses" VALUES ("1", "Mathematics");
INSERT INTO "Courses" VALUES ("2", "Physics");
INSERT INTO "Courses" VALUES ("3", "Chemistry");
INSERT INTO "Courses" VALUES ("4", "Biology");
INSERT INTO "Courses" VALUES ("5", "History");
INSERT INTO "Courses" VALUES ("6", "Literature");
INSERT INTO "Courses" VALUES ("7", "Computer Science");
INSERT INTO "Courses" VALUES ("8", "Philosophy");
INSERT INTO "Student_Enrolment" VALUES ("1", "101", "1");
INSERT INTO "Student_Enrolment" VALUES ("2", "102", "1");
INSERT INTO "Student_Enrolment" VALUES ("3", "101", "2");
INSERT INTO "Student_Enrolment" VALUES ("4", "103", "2");
INSERT INTO "Student_Enrolment" VALUES ("5", "104", "1");
INSERT INTO "Student_Enrolment_Courses" VALUES ("1", "1");
INSERT INTO "Student_Enrolment_Courses" VALUES ("2", "2");
INSERT INTO "Student_Enrolment_Courses" VALUES ("3", "3");
INSERT INTO "Student_Enrolment_Courses" VALUES ("4", "4");
INSERT INTO "Student_Enrolment_Courses" VALUES ("5", "5");
INSERT INTO "Student_Enrolment_Courses" VALUES ("6", "6");
INSERT INTO "Student_Enrolment_Courses" VALUES ("7", "7");
INSERT INTO "Student_Enrolment_Courses" VALUES ("8", "8");
INSERT INTO "Student_Enrolment_Courses" VALUES ("9", "1");
INSERT INTO "Student_Enrolment_Courses" VALUES ("10", "2");
INSERT INTO "Student_Enrolment_Courses" VALUES ("11", "3");
INSERT INTO "Student_Enrolment_Courses" VALUES ("12", "7");
INSERT INTO "Transcripts" VALUES ("1", "2023-01-15 10:00:00");
INSERT INTO "Transcripts" VALUES ("2", "2023-02-20 11:30:00");
INSERT INTO "Transcripts" VALUES ("3", "2023-03-10 09:45:00");
INSERT INTO "Transcripts" VALUES ("4", "2023-04-05 14:20:00");
INSERT INTO "Transcripts" VALUES ("5", "2023-05-12 16:00:00");
INSERT INTO "Transcripts" VALUES ("6", "2023-06-01 08:15:00");
INSERT INTO "Transcript_Contents" VALUES ("1", "1");
INSERT INTO "Transcript_Contents" VALUES ("2", "1");
INSERT INTO "Transcript_Contents" VALUES ("3", "2");
INSERT INTO "Transcript_Contents" VALUES ("4", "2");
INSERT INTO "Transcript_Contents" VALUES ("5", "2");
INSERT INTO "Transcript_Contents" VALUES ("6", "3");
INSERT INTO "Transcript_Contents" VALUES ("7", "3");
INSERT INTO "Transcript_Contents" VALUES ("8", "4");
INSERT INTO "Transcript_Contents" VALUES ("9", "5");
INSERT INTO "Transcript_Contents" VALUES ("10", "5");
INSERT INTO "Transcript_Contents" VALUES ("11", "5");
INSERT INTO "Transcript_Contents" VALUES ("12", "6");