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 ("1", "Mathematics");
INSERT INTO "course" VALUES ("2", "Physics");
INSERT INTO "course" VALUES ("3", "Chemistry");
INSERT INTO "course" VALUES ("4", "Biology");
INSERT INTO "course" VALUES ("5", "Computer Science");
INSERT INTO "course" VALUES ("6", "History");
INSERT INTO "course" VALUES ("7", "Literature");
INSERT INTO "course" VALUES ("8", "Art");
INSERT INTO "course" VALUES ("9", "Music");
INSERT INTO "course" VALUES ("10", "Physical Education");
INSERT INTO "teacher" VALUES ("101", "Alice Smith", "New York");
INSERT INTO "teacher" VALUES ("102", "Bob Johnson", "Los Angeles");
INSERT INTO "teacher" VALUES ("103", "Charlie Brown", "Chicago");
INSERT INTO "teacher" VALUES ("104", "Diana Prince", "New York");
INSERT INTO "teacher" VALUES ("105", "Eve Adams", "Houston");
INSERT INTO "teacher" VALUES ("106", "Frank White", "Chicago");
INSERT INTO "teacher" VALUES ("107", "Grace Lee", "New York");
INSERT INTO "teacher" VALUES ("108", "Henry King", "Los Angeles");
INSERT INTO "teacher" VALUES ("109", "Ivy Green", "Chicago");
INSERT INTO "teacher" VALUES ("110", "Jack Black", "Miami");
INSERT INTO "teacher" VALUES ("111", "Karen Blue", "New York");
INSERT INTO "teacher" VALUES ("112", "Liam Red", "Chicago");
INSERT INTO "teacher" VALUES ("113", "Mia Purple", "New York");
INSERT INTO "teacher" VALUES ("114", "Noah Grey", "Los Angeles");
INSERT INTO "teacher" VALUES ("115", "Olivia Pink", "Chicago");
INSERT INTO "course_arrange" VALUES ("1", "101", "90");
INSERT INTO "course_arrange" VALUES ("1", "104", "85");
INSERT INTO "course_arrange" VALUES ("1", "107", "92");
INSERT INTO "course_arrange" VALUES ("2", "102", "88");
INSERT INTO "course_arrange" VALUES ("2", "108", "91");
INSERT INTO "course_arrange" VALUES ("3", "103", "78");
INSERT INTO "course_arrange" VALUES ("3", "106", "80");
INSERT INTO "course_arrange" VALUES ("3", "109", "82");
INSERT INTO "course_arrange" VALUES ("4", "105", "95");
INSERT INTO "course_arrange" VALUES ("5", "101", "87");
INSERT INTO "course_arrange" VALUES ("5", "104", "89");
INSERT INTO "course_arrange" VALUES ("6", "103", "75");
INSERT INTO "course_arrange" VALUES ("6", "106", "77");
INSERT INTO "course_arrange" VALUES ("7", "107", "93");
INSERT INTO "course_arrange" VALUES ("8", "109", "84");
INSERT INTO "course_arrange" VALUES ("9", "110", "70");
INSERT INTO "course_arrange" VALUES ("10", "111", "96");
INSERT INTO "course_arrange" VALUES ("1", "112", "88");
INSERT INTO "course_arrange" VALUES ("2", "113", "90");
INSERT INTO "course_arrange" VALUES ("3", "114", "81");
INSERT INTO "course_arrange" VALUES ("4", "115", "94");