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,
"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 "teacher" VALUES ("1", "Alice Johnson", "Little Lever Urban District");
INSERT INTO "teacher" VALUES ("2", "Bob Smith", "Manchester");
INSERT INTO "teacher" VALUES ("3", "Carol White", "Liverpool");
INSERT INTO "teacher" VALUES ("4", "David Brown", "Little Lever Urban District");
INSERT INTO "teacher" VALUES ("5", "Eva Green", "Leeds");
INSERT INTO "teacher" VALUES ("6", "Frank Black", "Birmingham");
INSERT INTO "teacher" VALUES ("7", "Grace Lee", "Little Lever Urban District");
INSERT INTO "teacher" VALUES ("8", "Henry Adams", "Sheffield");
INSERT INTO "course" VALUES ("101", "Mathematics");
INSERT INTO "course" VALUES ("102", "Physics");
INSERT INTO "course" VALUES ("103", "Chemistry");
INSERT INTO "course" VALUES ("104", "Biology");
INSERT INTO "course" VALUES ("105", "History");
INSERT INTO "course_arrange" VALUES ("101", "1", "10");
INSERT INTO "course_arrange" VALUES ("102", "2", "11");
INSERT INTO "course_arrange" VALUES ("103", "3", "12");
INSERT INTO "course_arrange" VALUES ("104", "4", "10");
INSERT INTO "course_arrange" VALUES ("105", "5", "11");
INSERT INTO "course_arrange" VALUES ("101", "6", "12");
INSERT INTO "course_arrange" VALUES ("102", "7", "10");
INSERT INTO "course_arrange" VALUES ("103", "8", "11");
INSERT INTO "course_arrange" VALUES ("104", "2", "12");
INSERT INTO "course_arrange" VALUES ("105", "3", "10");