

-- Generated by Relational Schema Center on Fri Jul 30 19:20:07 CDT 2004 for DB2 Universal Database V8.2


CREATE TABLE SUPPLIERENT
  (OCC_SUPPLIERENT BIGINT NOT NULL DEFAULT 0,
   SUPPID INTEGER NOT NULL,
   SUPPNAME VARCHAR(250),
   SUPPSTREET1 VARCHAR(250),
   SUPPSTREET2 VARCHAR(250),
   SUPPCITY VARCHAR(250),
   SUPPSTATE VARCHAR(250),
   SUPPCOUNTRY VARCHAR(250),
   SUPPZIP VARCHAR(250),
   SUPPPHONE VARCHAR(250),
   SUPPCONTACT VARCHAR(250));

ALTER TABLE SUPPLIERENT
  ADD CONSTRAINT PK_SUPPLIERENT PRIMARY KEY (SUPPID);

CREATE TABLE SUPPLIERCOMPENT
  (OCC_SUPPLIERCOMPENT BIGINT NOT NULL DEFAULT 0,
   SUPPCOMPID VARCHAR(250) NOT NULL,
   SUPPCOMPSUPPID INTEGER NOT NULL,
   SUPPCOMPPRICE DOUBLE NOT NULL,
   SUPPCOMPQTY INTEGER NOT NULL,
   SUPPCOMPDISCOUNT DOUBLE NOT NULL,
   SUPPCOMPDELDATE INTEGER NOT NULL);

ALTER TABLE SUPPLIERCOMPENT
  ADD CONSTRAINT PK_SUPPLIERCOMPENT PRIMARY KEY (SUPPCOMPID, SUPPCOMPSUPPID);

CREATE TABLE SCOMPONENTENT
  (OCC_SCOMPONENTENT BIGINT NOT NULL DEFAULT 0,
   COMPID VARCHAR(250) NOT NULL,
   COMPNAME VARCHAR(250),
   COMPDESC VARCHAR(250),
   COMPUNIT VARCHAR(250),
   COMPCOST DOUBLE NOT NULL,
   QTYONORDER INTEGER NOT NULL,
   QTYDEMANDED INTEGER NOT NULL,
   LEADTIME INTEGER NOT NULL,
   CONTAINERSIZE INTEGER NOT NULL);

ALTER TABLE SCOMPONENTENT
  ADD CONSTRAINT PK_SCOMPONENTENT PRIMARY KEY (COMPID);

CREATE TABLE POENT
  (OCC_POENT BIGINT NOT NULL DEFAULT 0,
   PONUMBER INTEGER NOT NULL,
   POSUPPID INTEGER NOT NULL,
   POSITEID INTEGER NOT NULL);

ALTER TABLE POENT
  ADD CONSTRAINT PK_POENT PRIMARY KEY (PONUMBER);

CREATE TABLE POLINEENT
  (OCC_POLINEENT BIGINT NOT NULL DEFAULT 0,
   POLINENUMBER INTEGER NOT NULL,
   POLINEPOID INTEGER NOT NULL,
   POLINEID VARCHAR(250),
   POLINEQTY INTEGER NOT NULL,
   POLINEBALANCE DOUBLE NOT NULL,
   POLINEDELDATE DATE,
   POLINEMSG VARCHAR(250),
   POLINESPOENTINVERSE_PONUMBER INTEGER);

ALTER TABLE POLINEENT
  ADD CONSTRAINT PK_POLINEENT PRIMARY KEY (POLINENUMBER, POLINEPOID);