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

-- Table: Allergy_Type
CREATE TABLE "spider__allergy_1"."Allergy_Type" (
    "Allergy" TEXT NOT NULL,
    "AllergyType" TEXT,
    CONSTRAINT "Allergy_Type_pkey" PRIMARY KEY ("Allergy")
);

-- Table: Has_Allergy
CREATE TABLE "spider__allergy_1"."Has_Allergy" (
    "StuID" BIGINT,
    "Allergy" TEXT
);

-- Table: Student
CREATE TABLE "spider__allergy_1"."Student" (
    "StuID" BIGINT NOT NULL,
    "LName" TEXT,
    "Fname" TEXT,
    "Age" BIGINT,
    "Sex" TEXT,
    "Major" BIGINT,
    "Advisor" BIGINT,
    "city_code" TEXT,
    CONSTRAINT "Student_pkey" PRIMARY KEY ("StuID")
);

-- Foreign Keys
ALTER TABLE "spider__allergy_1"."Has_Allergy" ADD CONSTRAINT "fk_Has_Allergy_0" FOREIGN KEY ("Allergy") REFERENCES "spider__allergy_1"."Allergy_Type" ("Allergy") ON DELETE NO ACTION ON UPDATE NO ACTION;
