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 ("Course_ID") REFERENCES "course"("Course_ID")
);

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





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", "Computer Science");
INSERT INTO "course" VALUES ("106", "History");
INSERT INTO "course" VALUES ("107", "Literature");
INSERT INTO "teacher" VALUES ("1", "Alice Smith", "New York");
INSERT INTO "teacher" VALUES ("2", "Bob Johnson", "Los Angeles");
INSERT INTO "teacher" VALUES ("3", "Charlie Brown", "New York");
INSERT INTO "teacher" VALUES ("4", "Diana Prince", "Chicago");
INSERT INTO "teacher" VALUES ("5", "Eve Adams", "Los Angeles");
INSERT INTO "teacher" VALUES ("6", "Frank White", "Houston");
INSERT INTO "teacher" VALUES ("7", "Grace Lee", "New York");
INSERT INTO "teacher" VALUES ("8", "Henry Green", "Chicago");
INSERT INTO "teacher" VALUES ("9", "Ivy King", "Miami");
INSERT INTO "teacher" VALUES ("10", "Jack Hall", "Houston");
INSERT INTO "teacher" VALUES ("11", "Karen Scott", "Miami");
INSERT INTO "course_arrange" VALUES ("101", "1", "9");
INSERT INTO "course_arrange" VALUES ("102", "2", "10");
INSERT INTO "course_arrange" VALUES ("101", "3", "8");
INSERT INTO "course_arrange" VALUES ("103", "4", "9");
INSERT INTO "course_arrange" VALUES ("105", "5", "10");
INSERT INTO "course_arrange" VALUES ("106", "6", "7");
INSERT INTO "course_arrange" VALUES ("107", "7", "9");
INSERT INTO "course_arrange" VALUES ("104", "8", "8");
INSERT INTO "course_arrange" VALUES ("101", "9", "9");
INSERT INTO "course_arrange" VALUES ("102", "10", "10");
INSERT INTO "course_arrange" VALUES ("103", "11", "8");
INSERT INTO "course_arrange" VALUES ("105", "1", "9");
INSERT INTO "course_arrange" VALUES ("106", "2", "7");
INSERT INTO "course_arrange" VALUES ("107", "3", "10");
INSERT INTO "course_arrange" VALUES ("104", "4", "9");