-- Schema: spider__course_teach
CREATE SCHEMA IF NOT EXISTS "spider__course_teach";

-- Table: course
CREATE TABLE "spider__course_teach"."course" (
    "Course_ID" BIGINT NOT NULL,
    "Staring_Date" TEXT,
    "Course" TEXT,
    CONSTRAINT "course_pkey" PRIMARY KEY ("Course_ID")
);

-- Table: course_arrange
CREATE TABLE "spider__course_teach"."course_arrange" (
    "Course_ID" BIGINT NOT NULL,
    "Teacher_ID" BIGINT NOT NULL,
    "Grade" BIGINT NOT NULL,
    CONSTRAINT "course_arrange_pkey" PRIMARY KEY ("Course_ID", "Teacher_ID", "Grade")
);

-- Table: teacher
CREATE TABLE "spider__course_teach"."teacher" (
    "Teacher_ID" BIGINT NOT NULL,
    "Name" TEXT,
    "Age" TEXT,
    "Hometown" TEXT,
    CONSTRAINT "teacher_pkey" PRIMARY KEY ("Teacher_ID")
);

-- Foreign Keys
ALTER TABLE "spider__course_teach"."course_arrange" ADD CONSTRAINT "fk_course_arrange_0" FOREIGN KEY ("Teacher_ID") REFERENCES "spider__course_teach"."teacher" ("Teacher_ID") ON DELETE NO ACTION ON UPDATE NO ACTION;
ALTER TABLE "spider__course_teach"."course_arrange" ADD CONSTRAINT "fk_course_arrange_1" FOREIGN KEY ("Course_ID") REFERENCES "spider__course_teach"."course" ("Course_ID") ON DELETE NO ACTION ON UPDATE NO ACTION;
