CREATE TABLE "DEPT" 
(
  "DPT_SEQ"	INTEGER NOT NULL,
  "DPT_DEPT"	VARCHAR(30),
  "DPT_TEAM"	VARCHAR(30),
CONSTRAINT "DPT_SEQ_PK" PRIMARY KEY ("DPT_SEQ")
);

CREATE TABLE "MEMBER" 
(
  "MEM_SEQ"	INTEGER NOT NULL,
  "MEM_NAME"	VARCHAR(30),
  "MEM_TEAM_SEQ"	INTEGER,
  "MEM_YEAR_SALARY"	INTEGER,
CONSTRAINT "MEM_SEQ_PK" PRIMARY KEY ("MEM_SEQ")
);

CREATE TABLE "PROJECT" 
(
  "PRJ_SEQ"	INTEGER NOT NULL,
  "PRJ_NAME"	VARCHAR(50) NOT NULL,
  "PRJ_STARTDATE"	DATE,
  "PRJ_ENDDATE"	DATE,
  "PRJ_MANAGER_SEQ"	INTEGER,
  "PRJ_MEMBERCOUNT"	INTEGER,
  "PRJ_STATUS_CODE"	INTEGER,
CONSTRAINT "PRJ_SEQ_PK" PRIMARY KEY ("PRJ_SEQ")
);

CREATE TABLE "PROJECTMEMBER" 
(
  "PRM_SEQ"	INTEGER NOT NULL,
  "PRM_PRJ_SEQ"	INTEGER,
  "PRM_MEM_SEQ"	INTEGER,
CONSTRAINT "PRM_SEQ_PK" PRIMARY KEY ("PRM_SEQ")
);

CREATE GENERATOR "DPT_SEQ_GEN";
CREATE GENERATOR "MEM_SEQ_GEN";
CREATE GENERATOR "PRJ_SEQ_GEN";
CREATE GENERATOR "PRM_SEQ_GEN";

CREATE TRIGGER "SET_DPT_SEQ" FOR "DEPT" 
ACTIVE BEFORE INSERT POSITION 0
AS
BEGIN
    new.DPT_SEQ = gen_id(DPT_SEQ_GEN, 1);
END
 ;

CREATE TRIGGER "SET_MEM_SEQ" FOR "MEMBER" 
ACTIVE BEFORE INSERT POSITION 0
AS
BEGIN
    new.MEM_SEQ = gen_id(MEM_SEQ_GEN, 1);
END
 ;

CREATE TRIGGER "SET_PRJ_SEQ" FOR "PROJECT" 
ACTIVE BEFORE INSERT POSITION 0
AS
BEGIN
    new.PRJ_SEQ = gen_id(PRJ_SEQ_GEN, 1);
END
 ;

CREATE TRIGGER "SET_PRM_SEQ" FOR "PROJECTMEMBER" 
ACTIVE BEFORE INSERT POSITION 0
AS
BEGIN
    new.PRM_SEQ = gen_id(PRM_SEQ_GEN, 1);
END
 ;