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_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 UNIQUE,
"Name" TEXT,
"Age" TEXT,
"Hometown" TEXT,
PRIMARY KEY ("Teacher_ID")
);





INSERT INTO "course_arrange" VALUES ("101", "1", "8");
INSERT INTO "course_arrange" VALUES ("102", "2", "9");
INSERT INTO "course_arrange" VALUES ("103", "1", "10");
INSERT INTO "course_arrange" VALUES ("104", "4", "7");
INSERT INTO "course_arrange" VALUES ("105", "2", "8");
INSERT INTO "course_arrange" VALUES ("106", "1", "9");
INSERT INTO "course_arrange" VALUES ("107", "4", "10");
INSERT INTO "course_arrange" VALUES ("108", "5", "7");
INSERT INTO "course_arrange" VALUES ("109", "5", "8");
INSERT INTO "course_arrange" VALUES ("110", "1", "7");
INSERT INTO "teacher" VALUES ("1", "Alice", "35", "New York");
INSERT INTO "teacher" VALUES ("2", "Bob", "40", "Los Angeles");
INSERT INTO "teacher" VALUES ("3", "Charlie", "28", "Chicago");
INSERT INTO "teacher" VALUES ("4", "David", "50", "Houston");
INSERT INTO "teacher" VALUES ("5", "Eve", "32", "Phoenix");
INSERT INTO "teacher" VALUES ("6", "Frank", "45", "Philadelphia");
INSERT INTO "teacher" VALUES ("7", "Grace", "38", "San Antonio");
INSERT INTO "teacher" VALUES ("8", "Heidi", "29", "San Diego");