Project table (PROJECT)

The project table describes each project that the business is currently undertaking. Data contained in each row include the project number, name, person responsible, and schedule dates.

The project table is created with the following CREATE TABLE and ALTER TABLE statements:

CREATE TABLE PROJECT
      (PROJNO    CHAR(6)        NOT NULL,
       PROJNAME  VARCHAR(24)    NOT NULL DEFAULT,
       DEPTNO    CHAR(3)        NOT NULL,
       RESPEMP   CHAR(6)        NOT NULL,
       PRSTAFF   DECIMAL(5,2)           ,
       PRSTDATE  DATE                   ,
       PRENDATE  DATE                   ,
       MAJPROJ   CHAR(6)                ,
       PRIMARY KEY (PROJNO))

ALTER TABLE PROJECT 
              ADD FOREIGN KEY (DEPTNO) 
              REFERENCES DEPARTMENT 
              ON DELETE RESTRICT

ALTER TABLE PROJECT 
              ADD FOREIGN KEY (RESPEMP) 
              REFERENCES EMPLOYEE 
              ON DELETE RESTRICT

ALTER TABLE PROJECT 
              ADD FOREIGN KEY  RPP (MAJPROJ) 
              REFERENCES PROJECT 
              ON DELETE CASCADE

The following indexes are created:

CREATE UNIQUE INDEX XPROJ1 
              ON PROJECT (PROJNO)

CREATE INDEX XPROJ2 
              ON PROJECT (RESPEMP)

The following alias is created for the table:

CREATE ALIAS PROJ FOR PROJECT

The table below shows the contents of the columns:

Column name Description
PROJNO Project number
PROJNAME Project name
DEPTNO Department number of the department responsible for the project
RESPEMP Employee number of the person responsible for the project
PRSTAFF Estimated mean staffing
PRSTDATE Estimated start date of the project
PRENDATE Estimated end date of the project
MAJPROJ Controlling project number for sub projects