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,
"student_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", "101");
INSERT INTO "Student_Enrolment" VALUES ("2", "102");
INSERT INTO "Student_Enrolment" VALUES ("3", "103");
INSERT INTO "Student_Enrolment" VALUES ("4", "104");
INSERT INTO "Student_Enrolment" VALUES ("5", "105");
INSERT INTO "Student_Enrolment_Courses" VALUES ("1", "201");
INSERT INTO "Student_Enrolment_Courses" VALUES ("2", "202");
INSERT INTO "Student_Enrolment_Courses" VALUES ("3", "203");
INSERT INTO "Student_Enrolment_Courses" VALUES ("4", "204");
INSERT INTO "Student_Enrolment_Courses" VALUES ("5", "205");
INSERT INTO "Transcript_Contents" VALUES ("1");
INSERT INTO "Transcript_Contents" VALUES ("2");
INSERT INTO "Transcript_Contents" VALUES ("3");
INSERT INTO "Transcript_Contents" VALUES ("4");
INSERT INTO "Transcript_Contents" VALUES ("5");
INSERT INTO "Transcripts" VALUES ("10", "2023-01-15 09:00:00", "Initial transcript release for spring semester");
INSERT INTO "Transcripts" VALUES ("11", "2023-02-20 10:30:00", "Midterm transcript update");
INSERT INTO "Transcripts" VALUES ("12", "2023-01-15 09:00:01", "Duplicate date but later time transcript");
INSERT INTO "Transcripts" VALUES ("13", "2023-03-01 08:00:00", "Final transcript release for spring semester");
INSERT INTO "Transcripts" VALUES ("14", "2022-12-31 23:59:59", "Year-end transcript release for previous year");