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

CREATE TABLE "Student_Enrolment_Courses" (
"student_course_id" INT,
"course_id" INT,
PRIMARY KEY ("student_course_id")
);

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

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





INSERT INTO "Student_Enrolment" VALUES ("1", "202101");
INSERT INTO "Student_Enrolment" VALUES ("2", "202102");
INSERT INTO "Student_Enrolment" VALUES ("3", "202103");
INSERT INTO "Student_Enrolment" VALUES ("4", "202201");
INSERT INTO "Student_Enrolment" VALUES ("5", "202202");
INSERT INTO "Student_Enrolment_Courses" VALUES ("10", "1001");
INSERT INTO "Student_Enrolment_Courses" VALUES ("11", "1002");
INSERT INTO "Student_Enrolment_Courses" VALUES ("12", "1003");
INSERT INTO "Student_Enrolment_Courses" VALUES ("13", "1001");
INSERT INTO "Student_Enrolment_Courses" VALUES ("14", "1004");
INSERT INTO "Student_Enrolment_Courses" VALUES ("15", "1005");
INSERT INTO "Student_Enrolment_Courses" VALUES ("16", "1002");
INSERT INTO "Transcript_Contents" VALUES ("10");
INSERT INTO "Transcript_Contents" VALUES ("11");
INSERT INTO "Transcript_Contents" VALUES ("12");
INSERT INTO "Transcript_Contents" VALUES ("13");
INSERT INTO "Transcript_Contents" VALUES ("14");
INSERT INTO "Transcript_Contents" VALUES ("15");
INSERT INTO "Transcript_Contents" VALUES ("16");
INSERT INTO "Transcripts" VALUES ("100", "2021-05-15 09:30:00", "Initial release for spring semester courses");
INSERT INTO "Transcripts" VALUES ("101", "2021-04-10 08:00:00", "Early release for special courses");
INSERT INTO "Transcripts" VALUES ("102", "2022-01-20 10:15:00", "Winter semester transcript update");
INSERT INTO "Transcripts" VALUES ("103", "2020-12-01 14:00:00", "Preliminary transcript for fall semester");
INSERT INTO "Transcripts" VALUES ("104", "2021-06-01 12:00:00", "Final transcript release with corrections");
INSERT INTO "Transcripts" VALUES ("105", "2020-12-01 14:00:00", "Duplicate date transcript with different details");
INSERT INTO "Transcripts" VALUES ("106", "2023-03-10 11:30:00", "Latest transcript release for spring 2023");
INSERT INTO "Transcripts" VALUES ("107", "2021-04-10 08:00:00", "Additional early release for elective courses");