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 ("Teacher_ID") REFERENCES "teacher"("Teacher_ID"),
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", "History");
INSERT INTO "course" VALUES ("6", "Geography");
INSERT INTO "course" VALUES ("7", "English Literature");
INSERT INTO "course" VALUES ("8", "Computer Science");
INSERT INTO "course" VALUES ("9", "Art");
INSERT INTO "course" VALUES ("10", "Physical Education");
INSERT INTO "teacher" VALUES ("101", "Alice Johnson", "New York");
INSERT INTO "teacher" VALUES ("102", "Bob Smith", "Los Angeles");
INSERT INTO "teacher" VALUES ("103", "Carol White", "Chicago");
INSERT INTO "teacher" VALUES ("104", "David Brown", "Houston");
INSERT INTO "teacher" VALUES ("105", "Eva Green", "Phoenix");
INSERT INTO "teacher" VALUES ("106", "Frank Black", "Philadelphia");
INSERT INTO "teacher" VALUES ("107", "Grace Lee", "San Antonio");
INSERT INTO "teacher" VALUES ("108", "Henry Adams", "San Diego");
INSERT INTO "teacher" VALUES ("109", "Ivy Wilson", "Dallas");
INSERT INTO "teacher" VALUES ("110", "Jack Miller", "San Jose");
INSERT INTO "course_arrange" VALUES ("1", "101", "9");
INSERT INTO "course_arrange" VALUES ("2", "101", "10");
INSERT INTO "course_arrange" VALUES ("3", "102", "9");
INSERT INTO "course_arrange" VALUES ("4", "102", "10");
INSERT INTO "course_arrange" VALUES ("5", "103", "9");
INSERT INTO "course_arrange" VALUES ("6", "103", "10");
INSERT INTO "course_arrange" VALUES ("7", "104", "9");
INSERT INTO "course_arrange" VALUES ("8", "104", "10");
INSERT INTO "course_arrange" VALUES ("9", "105", "9");
INSERT INTO "course_arrange" VALUES ("10", "105", "10");
INSERT INTO "course_arrange" VALUES ("1", "106", "11");
INSERT INTO "course_arrange" VALUES ("2", "106", "11");
INSERT INTO "course_arrange" VALUES ("3", "107", "11");
INSERT INTO "course_arrange" VALUES ("4", "107", "11");
INSERT INTO "course_arrange" VALUES ("5", "108", "12");
INSERT INTO "course_arrange" VALUES ("6", "108", "12");
INSERT INTO "course_arrange" VALUES ("7", "109", "12");
INSERT INTO "course_arrange" VALUES ("8", "109", "12");
INSERT INTO "course_arrange" VALUES ("9", "110", "12");
INSERT INTO "course_arrange" VALUES ("10", "110", "12");
INSERT INTO "course_arrange" VALUES ("1", "101", "11");
INSERT INTO "course_arrange" VALUES ("2", "101", "12");
INSERT INTO "course_arrange" VALUES ("3", "102", "12");
INSERT INTO "course_arrange" VALUES ("4", "103", "11");
INSERT INTO "course_arrange" VALUES ("5", "104", "12");
INSERT INTO "course_arrange" VALUES ("6", "105", "11");
INSERT INTO "course_arrange" VALUES ("7", "106", "12");
INSERT INTO "course_arrange" VALUES ("8", "107", "9");
INSERT INTO "course_arrange" VALUES ("9", "108", "10");
INSERT INTO "course_arrange" VALUES ("10", "109", "9");