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", "Literature");
INSERT INTO "teacher" VALUES ("101", "Alice Smith", "30", "New York");
INSERT INTO "teacher" VALUES ("102", "Bob Johnson", "25", "Los Angeles");
INSERT INTO "teacher" VALUES ("103", "Charlie Brown", "40", "Chicago");
INSERT INTO "teacher" VALUES ("104", "Diana Prince", "22", "Miami");
INSERT INTO "teacher" VALUES ("105", "Eve Adams", "35", "Houston");
INSERT INTO "teacher" VALUES ("106", "Frank White", "22", "Seattle");
INSERT INTO "teacher" VALUES ("107", "Grace Lee", "28", "Boston");
INSERT INTO "teacher" VALUES ("108", "Henry King", "50", "Denver");
INSERT INTO "course_arrange" VALUES ("1", "101", "90");
INSERT INTO "course_arrange" VALUES ("2", "102", "85");
INSERT INTO "course_arrange" VALUES ("3", "103", "92");
INSERT INTO "course_arrange" VALUES ("4", "104", "88");
INSERT INTO "course_arrange" VALUES ("5", "105", "95");
INSERT INTO "course_arrange" VALUES ("1", "106", "87");
INSERT INTO "course_arrange" VALUES ("6", "107", "91");
INSERT INTO "course_arrange" VALUES ("7", "108", "80");
INSERT INTO "course_arrange" VALUES ("2", "101", "78");
INSERT INTO "course_arrange" VALUES ("3", "102", "89");
INSERT INTO "course_arrange" VALUES ("4", "103", "93");
INSERT INTO "course_arrange" VALUES ("5", "104", "86");
INSERT INTO "course_arrange" VALUES ("6", "105", "94");
INSERT INTO "course_arrange" VALUES ("7", "106", "82");