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 "course" (
"Course_ID" INT,
"Staring_Date" TEXT,
"Course" TEXT,
PRIMARY KEY ("Course_ID")
);

CREATE TABLE "course_arrange" (
"Course_ID" INT,
"Teacher_ID" INT,
"Grade" INT,
PRIMARY KEY ("Course_ID", "Teacher_ID", "Grade"),
FOREIGN KEY ("Teacher_ID") REFERENCES "teacher"("Teacher_ID")
);

CREATE TABLE "teacher" (
"Teacher_ID" INT,
"Name" TEXT,
"Hometown" TEXT,
PRIMARY KEY ("Teacher_ID")
);





INSERT INTO "course" VALUES ("1", "2023-09-01", "Mathematics");
INSERT INTO "course" VALUES ("2", "2023-09-01", "Physics");
INSERT INTO "course" VALUES ("3", "2023-09-15", "Chemistry");
INSERT INTO "course" VALUES ("4", "2023-10-01", "Biology");
INSERT INTO "course" VALUES ("5", "2023-10-01", "Computer Science");
INSERT INTO "course" VALUES ("6", "2023-11-01", "History");
INSERT INTO "course" VALUES ("7", "2023-11-01", "Literature");
INSERT INTO "teacher" VALUES ("1", "Alice Smith", "London");
INSERT INTO "teacher" VALUES ("2", "Bob Johnson", "Manchester");
INSERT INTO "teacher" VALUES ("3", "Charlie Brown", "Little Lever Urban District");
INSERT INTO "teacher" VALUES ("4", "Diana Miller", "Birmingham");
INSERT INTO "teacher" VALUES ("5", "Eve Davis", "Little Lever Urban District");
INSERT INTO "teacher" VALUES ("6", "Frank White", "Liverpool");
INSERT INTO "teacher" VALUES ("7", "Grace Taylor", "Little Lever Urban District");
INSERT INTO "teacher" VALUES ("8", "Henry Wilson", "Edinburgh");
INSERT INTO "course_arrange" VALUES ("1", "1", "10");
INSERT INTO "course_arrange" VALUES ("1", "2", "11");
INSERT INTO "course_arrange" VALUES ("2", "3", "12");
INSERT INTO "course_arrange" VALUES ("3", "4", "10");
INSERT INTO "course_arrange" VALUES ("4", "5", "11");
INSERT INTO "course_arrange" VALUES ("5", "6", "12");
INSERT INTO "course_arrange" VALUES ("6", "1", "10");
INSERT INTO "course_arrange" VALUES ("7", "2", "11");
INSERT INTO "course_arrange" VALUES ("1", "8", "10");
INSERT INTO "course_arrange" VALUES ("2", "8", "11");