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,
"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")
);

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





INSERT INTO "course" VALUES ("1", "2023-01-10", "Mathematics");
INSERT INTO "course" VALUES ("2", "2023-02-15", "Physics");
INSERT INTO "course" VALUES ("3", "2023-03-20", "Chemistry");
INSERT INTO "course" VALUES ("4", "2023-04-25", "Biology");
INSERT INTO "course" VALUES ("5", "2023-05-30", "History");
INSERT INTO "teacher" VALUES ("101", "45", "New York");
INSERT INTO "teacher" VALUES ("102", "38", "Los Angeles");
INSERT INTO "teacher" VALUES ("103", "50", "Chicago");
INSERT INTO "teacher" VALUES ("104", "29", "Houston");
INSERT INTO "teacher" VALUES ("105", "60", "Phoenix");
INSERT INTO "teacher" VALUES ("106", "35", "Philadelphia");
INSERT INTO "course_arrange" VALUES ("1", "101", "10");
INSERT INTO "course_arrange" VALUES ("1", "102", "11");
INSERT INTO "course_arrange" VALUES ("2", "103", "10");
INSERT INTO "course_arrange" VALUES ("3", "104", "12");
INSERT INTO "course_arrange" VALUES ("4", "105", "11");
INSERT INTO "course_arrange" VALUES ("5", "106", "12");
INSERT INTO "course_arrange" VALUES ("2", "101", "12");
INSERT INTO "course_arrange" VALUES ("3", "102", "10");
INSERT INTO "course_arrange" VALUES ("4", "103", "11");
INSERT INTO "course_arrange" VALUES ("5", "104", "10");