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 ("1", "101");
INSERT INTO "Student_Enrolment_Courses" VALUES ("2", "102");
INSERT INTO "Student_Enrolment_Courses" VALUES ("3", "103");
INSERT INTO "Student_Enrolment_Courses" VALUES ("4", "104");
INSERT INTO "Student_Enrolment_Courses" VALUES ("5", "105");
INSERT INTO "Student_Enrolment_Courses" VALUES ("6", "106");
INSERT INTO "Student_Enrolment_Courses" VALUES ("7", "107");
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 "Transcript_Contents" VALUES ("6");
INSERT INTO "Transcripts" VALUES ("1", "2021-06-15 10:00:00", "First semester transcripts");
INSERT INTO "Transcripts" VALUES ("2", "2021-12-20 15:30:00", "Second semester transcripts");
INSERT INTO "Transcripts" VALUES ("3", "2022-06-10 09:45:00", "Summer semester transcripts");
INSERT INTO "Transcripts" VALUES ("4", "2022-12-18 14:00:00", "Winter semester transcripts");
INSERT INTO "Transcripts" VALUES ("5", "2023-06-12 11:15:00", "Special transcripts");
INSERT INTO "Transcripts" VALUES ("6", "2023-12-22 16:45:00", "Final transcripts");