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

CREATE TABLE "teacher" (
"Teacher_ID" INT,
"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 ("1", "Alice Smith", "35", "New York");
INSERT INTO "teacher" VALUES ("2", "Bob Johnson", "42", "Los Angeles");
INSERT INTO "teacher" VALUES ("3", "Charlie Brown", "28", "Chicago");
INSERT INTO "teacher" VALUES ("4", "Diana Prince", "50", "Washington D.C.");
INSERT INTO "teacher" VALUES ("5", "Eve Adams", "30", "Houston");
INSERT INTO "teacher" VALUES ("6", "Frank White", "60", "Miami");
INSERT INTO "teacher" VALUES ("7", "Grace Lee", "25", "San Francisco");
INSERT INTO "teacher" VALUES ("8", "Henry Green", "42", "Boston");
INSERT INTO "teacher" VALUES ("9", "Ivy Black", "35", "Seattle");
INSERT INTO "teacher" VALUES ("10", "Jack King", "50", "Denver");
INSERT INTO "course_arrange" VALUES ("1", "1", "90");
INSERT INTO "course_arrange" VALUES ("1", "2", "85");
INSERT INTO "course_arrange" VALUES ("2", "3", "92");
INSERT INTO "course_arrange" VALUES ("3", "4", "88");
INSERT INTO "course_arrange" VALUES ("4", "5", "95");
INSERT INTO "course_arrange" VALUES ("5", "6", "80");
INSERT INTO "course_arrange" VALUES ("6", "7", "87");
INSERT INTO "course_arrange" VALUES ("7", "8", "91");
INSERT INTO "course_arrange" VALUES ("1", "9", "89");
INSERT INTO "course_arrange" VALUES ("2", "10", "86");
INSERT INTO "course_arrange" VALUES ("3", "1", "78");
INSERT INTO "course_arrange" VALUES ("4", "2", "93");
INSERT INTO "course_arrange" VALUES ("5", "3", "84");
INSERT INTO "course_arrange" VALUES ("6", "4", "90");
INSERT INTO "course_arrange" VALUES ("7", "5", "82");
INSERT INTO "course_arrange" VALUES ("1", "6", "94");
INSERT INTO "course_arrange" VALUES ("2", "7", "79");
INSERT INTO "course_arrange" VALUES ("3", "8", "88");
INSERT INTO "course_arrange" VALUES ("4", "9", "91");
INSERT INTO "course_arrange" VALUES ("5", "10", "85");