CREATE TABLE CUS_TABLE1 ( CUS_TABLE1_ID VARCHAR2(32), AD_CLIENT_ID VARCHAR2(32), AD_ORG_ID VARCHAR2(32), ISACTIVE CHAR(1 BYTE) DEFAULT 'Y', UPDATED DATE, UPDATEDBY VARCHAR2(32), CREATED DATE, CREATEDBY VARCHAR2(32), CUS_MYLIST VARCHAR2(60), MYNAME VARCHAR2(50), MYDOB DATE ); ALTER TABLE CUS_TABLE1 ADD CONSTRAINT CUS_TABLE1_KEY PRIMARY KEY (CUS_TABLE1_ID) ENABLE; ALTER TABLE CUS_TABLE1 ADD CONSTRAINT CUS_TABLE1_ISACTCHK CHECK (ISACTIVE IN ('Y','N')) ENABLE; ALTER TABLE CUS_TABLE1 ADD CONSTRAINT CUS_TABLE1_CLIENT FOREIGN KEY (AD_CLIENT_ID) REFERENCES AD_CLIENT (AD_CLIENT_ID) ENABLE; ALTER TABLE CUS_TABLE1 ADD CONSTRAINT CUS_TABLE1_ORG FOREIGN KEY (AD_ORG_ID) REFERENCES AD_ORG (AD_ORG_ID) ENABLE; CREATE TABLE CUS_TABLE2 ( CUS_TABLE2_ID VARCHAR2(32), AD_CLIENT_ID VARCHAR2(32), AD_ORG_ID VARCHAR2(32), ISACTIVE CHAR(1 BYTE) DEFAULT 'Y', UPDATED DATE, UPDATEDBY VARCHAR2(32), CREATED DATE, CREATEDBY VARCHAR2(32), CUS_TABLE1_ID VARCHAR2(32), MYDETAILS VARCHAR2(255) ); ALTER TABLE CUS_TABLE2 ADD CONSTRAINT CUS_TABLE2_KEY PRIMARY KEY (CUS_TABLE2_ID) ENABLE; ALTER TABLE CUS_TABLE2 ADD CONSTRAINT CUS_TABLE2_ISACTCHK CHECK (ISACTIVE IN ('Y','N')) ENABLE; ALTER TABLE CUS_TABLE2 ADD CONSTRAINT CUS_TABLE2_CLIENT FOREIGN KEY (AD_CLIENT_ID) REFERENCES AD_CLIENT (AD_CLIENT_ID) ENABLE; ALTER TABLE CUS_TABLE2 ADD CONSTRAINT CUS_TABLE2_ORG FOREIGN KEY (AD_ORG_ID) REFERENCES AD_ORG (AD_ORG_ID) ENABLE; ALTER TABLE CUS_TABLE2 ADD CONSTRAINT CUS_TABLE2_TABLE1 FOREIGN KEY (CUS_TABLE1_ID) REFERENCES CUS_TABLE1 (CUS_TABLE1_ID) ENABLE;