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,
"Staring_Date" TEXT,
PRIMARY KEY ("Course_ID")
);

CREATE TABLE "course_arrange" (
"Course_ID" INT,
"Teacher_ID" INT,
"Grade" INT,
PRIMARY KEY ("Course_ID", "Teacher_ID", "Grade")
);

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





INSERT INTO "course" VALUES ("1", "2023-01-10");
INSERT INTO "course" VALUES ("2", "2023-02-15");
INSERT INTO "course" VALUES ("3", "2023-03-20");
INSERT INTO "course" VALUES ("4", "2023-04-25");
INSERT INTO "course" VALUES ("5", "2023-05-30");
INSERT INTO "teacher" VALUES ("101", "New York");
INSERT INTO "teacher" VALUES ("102", "Los Angeles");
INSERT INTO "teacher" VALUES ("103", "New York");
INSERT INTO "teacher" VALUES ("104", "Chicago");
INSERT INTO "teacher" VALUES ("105", "Houston");
INSERT INTO "teacher" VALUES ("106", "Los Angeles");
INSERT INTO "teacher" VALUES ("107", "Phoenix");
INSERT INTO "teacher" VALUES ("108", "Philadelphia");
INSERT INTO "teacher" VALUES ("109", "Houston");
INSERT INTO "teacher" VALUES ("110", "San Antonio");
INSERT INTO "course_arrange" VALUES ("1", "101", "9");
INSERT INTO "course_arrange" VALUES ("1", "102", "10");
INSERT INTO "course_arrange" VALUES ("2", "103", "9");
INSERT INTO "course_arrange" VALUES ("2", "104", "11");
INSERT INTO "course_arrange" VALUES ("3", "105", "10");
INSERT INTO "course_arrange" VALUES ("3", "106", "9");
INSERT INTO "course_arrange" VALUES ("4", "107", "12");
INSERT INTO "course_arrange" VALUES ("4", "108", "11");
INSERT INTO "course_arrange" VALUES ("5", "109", "10");
INSERT INTO "course_arrange" VALUES ("5", "110", "12");