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,
"Age" 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", "English");
INSERT INTO "teacher" VALUES ("101", "Alice Smith", "35", "New York");
INSERT INTO "teacher" VALUES ("102", "Bob Johnson", "42", "Los Angeles");
INSERT INTO "teacher" VALUES ("103", "Charlie Brown", "28", "Chicago");
INSERT INTO "teacher" VALUES ("104", "Diana Prince", "50", "New York");
INSERT INTO "teacher" VALUES ("105", "Eve Adams", "30", "Houston");
INSERT INTO "teacher" VALUES ("106", "Frank White", "45", "Chicago");
INSERT INTO "teacher" VALUES ("107", "Grace Lee", "38", "New York");
INSERT INTO "teacher" VALUES ("108", "Henry Green", "55", "Los Angeles");
INSERT INTO "teacher" VALUES ("109", "Ivy King", "32", "Chicago");
INSERT INTO "teacher" VALUES ("110", "Jack Black", "40", "New York");
INSERT INTO "teacher" VALUES ("111", "Karen Blue", "29", "Miami");
INSERT INTO "teacher" VALUES ("112", "Liam Red", "48", "New York");
INSERT INTO "teacher" VALUES ("113", "Mia Purple", "33", "Houston");
INSERT INTO "teacher" VALUES ("114", "Noah Yellow", "37", "Chicago");
INSERT INTO "teacher" VALUES ("115", "Olivia Orange", "41", "New York");
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 ("1", "110", "88");
INSERT INTO "course_arrange" VALUES ("1", "112", "91");
INSERT INTO "course_arrange" VALUES ("1", "115", "89");
INSERT INTO "course_arrange" VALUES ("2", "102", "78");
INSERT INTO "course_arrange" VALUES ("2", "108", "80");
INSERT INTO "course_arrange" VALUES ("3", "103", "95");
INSERT INTO "course_arrange" VALUES ("3", "106", "87");
INSERT INTO "course_arrange" VALUES ("3", "109", "93");
INSERT INTO "course_arrange" VALUES ("3", "114", "86");
INSERT INTO "course_arrange" VALUES ("4", "105", "75");
INSERT INTO "course_arrange" VALUES ("4", "113", "79");
INSERT INTO "course_arrange" VALUES ("5", "101", "82");
INSERT INTO "course_arrange" VALUES ("5", "104", "84");
INSERT INTO "course_arrange" VALUES ("6", "107", "70");
INSERT INTO "course_arrange" VALUES ("7", "110", "98");
INSERT INTO "course_arrange" VALUES ("7", "112", "96");
INSERT INTO "course_arrange" VALUES ("7", "115", "97");
INSERT INTO "course_arrange" VALUES ("1", "103", "80");
INSERT INTO "course_arrange" VALUES ("2", "101", "75");
INSERT INTO "course_arrange" VALUES ("3", "102", "90");
INSERT INTO "course_arrange" VALUES ("4", "106", "85");
INSERT INTO "course_arrange" VALUES ("5", "109", "92");
INSERT INTO "course_arrange" VALUES ("6", "111", "78");
INSERT INTO "course_arrange" VALUES ("7", "113", "88");