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 UNIQUE,
"course_id" INT,
PRIMARY KEY ("student_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 "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", "1002");
INSERT INTO "Transcripts" VALUES ("100", "2021-06-01 10:00:00");
INSERT INTO "Transcripts" VALUES ("101", "2021-12-01 10:00:00");
INSERT INTO "Transcripts" VALUES ("102", "2022-06-01 10:00:00");
INSERT INTO "Transcripts" VALUES ("103", "2022-12-01 10:00:00");
INSERT INTO "Transcripts" VALUES ("104", "2023-06-01 10:00:00");
INSERT INTO "Transcript_Contents" VALUES ("10", "100");
INSERT INTO "Transcript_Contents" VALUES ("10", "101");
INSERT INTO "Transcript_Contents" VALUES ("10", "102");
INSERT INTO "Transcript_Contents" VALUES ("11", "100");
INSERT INTO "Transcript_Contents" VALUES ("11", "103");
INSERT INTO "Transcript_Contents" VALUES ("12", "104");
INSERT INTO "Transcript_Contents" VALUES ("13", "101");
INSERT INTO "Transcript_Contents" VALUES ("13", "102");
INSERT INTO "Transcript_Contents" VALUES ("13", "103");
INSERT INTO "Transcript_Contents" VALUES ("13", "104");
INSERT INTO "Transcript_Contents" VALUES ("14", "104");
INSERT INTO "Transcript_Contents" VALUES ("15", "100");
INSERT INTO "Transcript_Contents" VALUES ("15", "101");