DROP  table ADDRESS cascade;
CREATE TABLE ADDRESS (id VARCHAR(255) PRIMARY KEY,        street VARCHAR(255),        city VARCHAR(255),        state VARCHAR(255),zip VARCHAR(255));

DROP table PHONE_TABLE cascade;
CREATE TABLE PHONE_TABLE(id VARCHAR2(255) PRIMARY KEY,area VARCHAR2(255),phone_number VARCHAR2(255),FK_FOR_ADDRESS VARCHAR2(255));

DROP table CUSTOMER_TABLE cascade;
CREATE TABLE CUSTOMER_TABLE ( ID VARCHAR(255)   PRIMARY KEY NOT NULL, NAME VARCHAR(255) , COUNTRY VARCHAR(255), CODE VARCHAR(255), FK5_FOR_CUSTOMER_TABLE VARCHAR(255) , FK6_FOR_CUSTOMER_TABLE VARCHAR(255));

DROP TABLE TRIM_TABLE cascade;
CREATE TABLE TRIM_TABLE ( ID VARCHAR(255) PRIMARY KEY NOT NULL, NAME CHAR(30) NOT NULL);

DROP table ALIAS_TABLE cascade;
CREATE TABLE ALIAS_TABLE(id VARCHAR2(255) PRIMARY KEY,         alias VARCHAR2(255),         FK1_FOR_CUSTOMER_TABLE  VARCHAR2(255),         FK2_FOR_CUSTOMER_TABLE  VARCHAR2(255));

DROP table FKS_ALIAS_CUSTOMER cascade;
CREATE TABLE FKS_ALIAS_CUSTOMER( FK_FOR_CUSTOMER_TABLE VARCHAR2(255) ,           FK_FOR_ALIAS_TABLE VARCHAR2(255));

DROP table FKS_ANOOP_CNOOP cascade;
CREATE TABLE FKS_ANOOP_CNOOP( FK8_FOR_CUSTOMER_TABLE VARCHAR2(255) ,           FK2_FOR_ALIAS_TABLE VARCHAR2(255));

DROP table CREDITCARD_TABLE cascade;
CREATE TABLE CREDITCARD_TABLE(id VARCHAR2(255) PRIMARY KEY, TYPE VARCHAR2(255), EXPIRES VARCHAR2(255), APPROVED NUMBER,  CREDITCARD_NUMBER VARCHAR2(255), balance DOUBLE, FK3_FOR_CUSTOMER_TABLE VARCHAR2(255),         FK_FOR_ORDER_TABLE VARCHAR2(255));

DROP table ORDER_TABLE cascade;
CREATE TABLE  ORDER_TABLE       (id VARCHAR2(255) PRIMARY KEY,        TOTALPRICE DOUBLE ,        FK4_FOR_CUSTOMER_TABLE VARCHAR2(255),        FK0_FOR_LINEITEM_TABLE VARCHAR2(255));

DROP TABLE PRODUCT_DETAILS cascade;
CREATE TABLE PRODUCT_DETAILS ( ID VARCHAR(255)  PRIMARY KEY NOT NULL, WHOUSE VARCHAR(255) , LICENSE_KEY INTEGER);

DROP TABLE PRODUCT_TABLE cascade;
CREATE TABLE PRODUCT_TABLE ( ID VARCHAR(255)   PRIMARY KEY NOT NULL, NAME VARCHAR2(255) , PRICE DOUBLE , QUANTITY INTEGER, PNUM BIGINT , PRODUCT_TYPE VARCHAR2(255), INCEPTION DATE, SOLD DATE, MODEL INTEGER, REV DOUBLE);

DROP TABLE PRICED_PRODUCT_TABLE cascade; 
CREATE TABLE PRICED_PRODUCT_TABLE (ID VARCHAR2(255) PRIMARY KEY NOT NULL, NAME VARCHAR2(255), PRICE DOUBLE , QUANTITY INTEGER, PNUM BIGINT ) ;

DROP table SPOUSE_TABLE cascade;
CREATE TABLE SPOUSE_TABLE (ID VARCHAR2(255) PRIMARY KEY,  FIRSTNAME VARCHAR2(255), MAIDENNAME VARCHAR2(255), LASTNAME VARCHAR2(255), SOCSECNUM VARCHAR2(255), FK7_FOR_CUSTOMER_TABLE VARCHAR2(255), FK_FOR_INFO_TABLE VARCHAR2(255) );

DROP table INFO_TABLE cascade;
CREATE TABLE INFO_TABLE (ID VARCHAR2(255) PRIMARY KEY, INFOSTREET VARCHAR2(255), INFOCITY VARCHAR2(255), INFOSTATE VARCHAR2(255), INFOZIP VARCHAR2(255), FK_FOR_SPOUSE_TABLE VARCHAR2(255) );

DROP table LINEITEM_TABLE cascade;
CREATE TABLE LINEITEM_TABLE(id VARCHAR2(255) PRIMARY KEY,quantity integer,FK_FOR_PRODUCT_TABLE VARCHAR2(255),FK1_FOR_ORDER_TABLE VARCHAR2(255));

ALTER TABLE PHONE_TABLE add constraint FK_FOR_ADDRESS Foreign Key (FK_FOR_ADDRESS) references ADDRESS(id)ON DELETE CASCADE;

ALTER TABLE ALIAS_TABLE add constraint FK1_FOR_CUSTOMER_TABLE Foreign Key (FK1_FOR_CUSTOMER_TABLE) references CUSTOMER_TABLE(id) ON DELETE CASCADE;

ALTER TABLE ALIAS_TABLE add constraint FK2_FOR_CUSTOMER_TABLE Foreign Key (FK2_FOR_CUSTOMER_TABLE) references CUSTOMER_TABLE(id) ON DELETE CASCADE;

ALTER TABLE FKS_ALIAS_CUSTOMER  add constraint FK_FOR_CUSTOMER_TABLE Foreign Key (FK_FOR_CUSTOMER_TABLE) references CUSTOMER_TABLE(id) ON DELETE CASCADE;

ALTER TABLE FKS_ALIAS_CUSTOMER  add constraint FK_FOR_ALIAS_TABLE Foreign Key (FK_FOR_ALIAS_TABLE) references ALIAS_TABLE(id) ON DELETE CASCADE;

ALTER TABLE FKS_ANOOP_CNOOP  add constraint FK2_FOR_ALIAS_TABLE Foreign Key (FK2_FOR_ALIAS_TABLE) references ALIAS_TABLE(id) ON DELETE CASCADE;

ALTER TABLE FKS_ANOOP_CNOOP  add constraint FK8_FOR_CUSTOMER_TABLE Foreign Key (FK8_FOR_CUSTOMER_TABLE) references CUSTOMER_TABLE(id) ON DELETE CASCADE;

ALTER TABLE CREDITCARD_TABLE add constraint FK3_FOR_CUSTOMER_TABLE Foreign Key (FK3_FOR_CUSTOMER_TABLE) references CUSTOMER_TABLE(id) ON DELETE CASCADE;

ALTER TABLE CREDITCARD_TABLE add constraint FK_FOR_ORDER_TABLE Foreign Key (FK_FOR_ORDER_TABLE) references ORDER_TABLE(id) ON DELETE CASCADE;

ALTER TABLE ORDER_TABLE add constraint FK4_FOR_CUSTOMER_TABLE Foreign Key (FK4_FOR_CUSTOMER_TABLE) references CUSTOMER_TABLE(id) ON DELETE CASCADE;

ALTER TABLE ORDER_TABLE add constraint FK0_FOR_LINEITEM_TABLE Foreign Key (FK0_FOR_LINEITEM_TABLE) references LINEITEM_TABLE(id) ON DELETE CASCADE;

ALTER TABLE LINEITEM_TABLE add constraint FK_FOR_PRODUCT_TABLE Foreign Key (FK_FOR_PRODUCT_TABLE) references PRODUCT_TABLE(id) ON DELETE CASCADE;

ALTER TABLE LINEITEM_TABLE add constraint FK1_FOR_ORDER_TABLE Foreign Key (FK1_FOR_ORDER_TABLE) references ORDER_TABLE(id) ON DELETE CASCADE;

ALTER TABLE CUSTOMER_TABLE add constraint FK5_FOR_CUSTOMER_TABLE Foreign Key (FK5_FOR_CUSTOMER_TABLE) references ADDRESS(id) ON DELETE CASCADE;

ALTER TABLE CUSTOMER_TABLE add constraint FK6_FOR_CUSTOMER_TABLE Foreign Key (FK6_FOR_CUSTOMER_TABLE) references ADDRESS(id) ON DELETE CASCADE;

ALTER TABLE SPOUSE_TABLE add constraint FK7_FOR_CUSTOMER_TABLE Foreign Key (FK7_FOR_CUSTOMER_TABLE) references CUSTOMER_TABLE(id) ON DELETE CASCADE;

ALTER TABLE SPOUSE_TABLE add constraint FK_FOR_INFO_TABLE Foreign Key (FK_FOR_INFO_TABLE) references INFO_TABLE(id) ON DELETE CASCADE;

ALTER TABLE INFO_TABLE add constraint FK_FOR_SPOUSE_TABLE Foreign Key (FK_FOR_SPOUSE_TABLE) references SPOUSE_TABLE(id) ON DELETE CASCADE;

DROP  table BEANEJB_1X1_BI_BTOB cascade;
CREATE TABLE BEANEJB_1X1_BI_BTOB   ( id VARCHAR(255)  PRIMARY KEY,      name VARCHAR(255) ,      value NUMBER NOT NULL,     FK1_FOR_AEJB_1X1_BI_BTOB VARCHAR(255),     FK2_FOR_AEJB_1X1_BI_BTOB VARCHAR(255),     FK1_FOR_BEJB_1X1_BI_BTOB VARCHAR(255),     FK2_FOR_BEJB_1X1_BI_BTOB VARCHAR(255));

DROP table AEJB_1X1_BI_BTOB cascade;
CREATE TABLE  AEJB_1X1_BI_BTOB    ( id VARCHAR(255)  PRIMARY KEY,      name VARCHAR(255) ,      value NUMBER NOT NULL);

DROP table BEJB_1X1_BI_BTOB cascade;
CREATE TABLE BEJB_1X1_BI_BTOB    ( id  VARCHAR(255) PRIMARY KEY,      name VARCHAR(255),      value NUMBER NOT NULL,     FK_FOR_AEJB_1X1_BI_BTOB VARCHAR(255));

ALTER TABLE BEANEJB_1X1_BI_BTOB add constraint FK1_FOR_AEJB_1X1_BI_BTOB  Foreign Key (FK1_FOR_AEJB_1X1_BI_BTOB) references AEJB_1X1_BI_BTOB(id)ON DELETE CASCADE;

ALTER TABLE BEANEJB_1X1_BI_BTOB add constraint FK2_FOR_AEJB_1X1_BI_BTOB  Foreign Key (FK2_FOR_AEJB_1X1_BI_BTOB) references AEJB_1X1_BI_BTOB(id)ON DELETE CASCADE;

ALTER TABLE BEANEJB_1X1_BI_BTOB add constraint FK1_FOR_BEJB_1X1_BI_BTOB  Foreign Key (FK1_FOR_BEJB_1X1_BI_BTOB) references BEJB_1X1_BI_BTOB(id)ON DELETE CASCADE;

ALTER TABLE BEANEJB_1X1_BI_BTOB add constraint FK2_FOR_BEJB_1X1_BI_BTOB  Foreign Key (FK2_FOR_BEJB_1X1_BI_BTOB) references BEJB_1X1_BI_BTOB(id)ON DELETE CASCADE;

ALTER TABLE BEJB_1X1_BI_BTOB add constraint FK_FOR_AEJB_1X1_BI_BTOB  Foreign Key (FK_FOR_AEJB_1X1_BI_BTOB) references AEJB_1X1_BI_BTOB(id)ON DELETE CASCADE;

DROP  table BEANEJB_1X1_BI_CASCADE cascade;
CREATE TABLE BEANEJB_1X1_BI_CASCADE   ( id VARCHAR(255)  PRIMARY KEY,      name VARCHAR(255) ,      value NUMBER NOT NULL,     FK1_FOR_AEJB_1X1_BI_CASCADE VARCHAR(255),     FK2_FOR_AEJB_1X1_BI_CASCADE VARCHAR(255),     FK1_FOR_BEJB_1X1_BI_CASCADE VARCHAR(255),     FK2_FOR_BEJB_1X1_BI_CASCADE VARCHAR(255));

DROP table AEJB_1X1_BI_CASCADE cascade;
CREATE TABLE  AEJB_1X1_BI_CASCADE    ( id VARCHAR(255)  PRIMARY KEY,      name VARCHAR(255) ,      value NUMBER NOT NULL);

DROP table BEJB_1X1_BI_CASCADE cascade;
CREATE TABLE BEJB_1X1_BI_CASCADE    ( id  VARCHAR(255) PRIMARY KEY,      name VARCHAR(255),      value NUMBER NOT NULL,     FK_FOR_AEJB_1X1_BI_CASCADE VARCHAR(255));

ALTER TABLE BEANEJB_1X1_BI_CASCADE add constraint FK1_FOR_AEJB_1X1_BI_CASCADE  Foreign Key (FK1_FOR_AEJB_1X1_BI_CASCADE) references AEJB_1X1_BI_CASCADE(id);

ALTER TABLE BEANEJB_1X1_BI_CASCADE add constraint FK2_FOR_AEJB_1X1_BI_CASCADE  Foreign Key (FK2_FOR_AEJB_1X1_BI_CASCADE) references AEJB_1X1_BI_CASCADE(id);

ALTER TABLE BEANEJB_1X1_BI_CASCADE add constraint FK1_FOR_BEJB_1X1_BI_CASCADE  Foreign Key (FK1_FOR_BEJB_1X1_BI_CASCADE) references BEJB_1X1_BI_CASCADE(id);

ALTER TABLE BEANEJB_1X1_BI_CASCADE add constraint FK2_FOR_BEJB_1X1_BI_CASCADE  Foreign Key (FK2_FOR_BEJB_1X1_BI_CASCADE) references BEJB_1X1_BI_CASCADE(id);

DROP  table BEANEJB_1XM_BI_DELETE cascade;
CREATE TABLE BEANEJB_1XM_BI_DELETE   ( id VARCHAR(255)  PRIMARY KEY,      name VARCHAR(255) ,      value NUMBER NOT NULL,     FK1_FOR_AEJB_1XM_BI_DELETE VARCHAR(255),     FK2_FOR_AEJB_1XM_BI_DELETE VARCHAR(255),     FK1_FOR_BEJB_1XM_BI_DELETE VARCHAR(255),     FK2_FOR_BEJB_1XM_BI_DELETE VARCHAR(255));

DROP table AEJB_1XM_BI_DELETE cascade;
CREATE TABLE  AEJB_1XM_BI_DELETE    ( id VARCHAR(255)  PRIMARY KEY,      name VARCHAR(255) ,      value NUMBER NOT NULL);

DROP table BEJB_1XM_BI_DELETE cascade;
CREATE TABLE BEJB_1XM_BI_DELETE    ( id  VARCHAR(255) PRIMARY KEY,      name VARCHAR(255),      value NUMBER NOT NULL,     FK_FOR_AEJB_1XM_BI_DELETE VARCHAR(255));

ALTER TABLE BEANEJB_1XM_BI_DELETE add constraint FK1_FOR_AEJB_1XM_BI_DELETE  Foreign Key (FK1_FOR_AEJB_1XM_BI_DELETE) references AEJB_1XM_BI_DELETE(id);

ALTER TABLE BEANEJB_1XM_BI_DELETE add constraint FK2_FOR_AEJB_1XM_BI_DELETE  Foreign Key (FK2_FOR_AEJB_1XM_BI_DELETE) references AEJB_1XM_BI_DELETE(id);

ALTER TABLE BEANEJB_1XM_BI_DELETE add constraint FK1_FOR_BEJB_1XM_BI_DELETE  Foreign Key (FK1_FOR_BEJB_1XM_BI_DELETE) references BEJB_1XM_BI_DELETE(id);

ALTER TABLE BEANEJB_1XM_BI_DELETE add constraint FK2_FOR_BEJB_1XM_BI_DELETE  Foreign Key (FK2_FOR_BEJB_1XM_BI_DELETE) references BEJB_1XM_BI_DELETE(id);

ALTER TABLE BEJB_1XM_BI_DELETE add constraint FK_FOR_AEJB_1XM_BI_DELETE  Foreign Key (FK_FOR_AEJB_1XM_BI_DELETE) references AEJB_1XM_BI_DELETE(id);

DROP  table BEANEJB_1XM_UNI_BTOB cascade;
CREATE TABLE BEANEJB_1XM_UNI_BTOB   ( id VARCHAR(255)  PRIMARY KEY,      name VARCHAR(255) ,      value NUMBER NOT NULL,     FK1_FOR_AEJB_1XM_UNI_BTOB VARCHAR(255),     FK2_FOR_AEJB_1XM_UNI_BTOB VARCHAR(255),     FK1_FOR_BEJB_1XM_UNI_BTOB VARCHAR(255),     FK2_FOR_BEJB_1XM_UNI_BTOB VARCHAR(255),     FK3_FOR_BEJB_1XM_UNI_BTOB VARCHAR(255),      FK4_FOR_BEJB_1XM_UNI_BTOB VARCHAR(255));

DROP table AEJB_1XM_UNI_BTOB cascade;
CREATE TABLE  AEJB_1XM_UNI_BTOB    ( id VARCHAR(255)  PRIMARY KEY,      name VARCHAR(255) ,      value NUMBER NOT NULL);

DROP table BEJB_1XM_UNI_BTOB cascade;
CREATE TABLE BEJB_1XM_UNI_BTOB    ( id  VARCHAR(255) PRIMARY KEY,      name VARCHAR(255),      value NUMBER NOT NULL,     FK_FOR_AEJB_1XM_UNI_BTOB VARCHAR(255));

ALTER TABLE BEANEJB_1XM_UNI_BTOB add constraint FK1_FOR_AEJB_1XM_UNI_BTOB  Foreign Key (FK1_FOR_AEJB_1XM_UNI_BTOB) references AEJB_1XM_UNI_BTOB(id)ON DELETE CASCADE;

ALTER TABLE BEANEJB_1XM_UNI_BTOB add constraint FK2_FOR_AEJB_1XM_UNI_BTOB  Foreign Key (FK2_FOR_AEJB_1XM_UNI_BTOB) references AEJB_1XM_UNI_BTOB(id)ON DELETE CASCADE;

ALTER TABLE BEANEJB_1XM_UNI_BTOB add constraint FK1_FOR_BEJB_1XM_UNI_BTOB  Foreign Key (FK1_FOR_BEJB_1XM_UNI_BTOB) references BEJB_1XM_UNI_BTOB(id)ON DELETE CASCADE;

ALTER TABLE BEANEJB_1XM_UNI_BTOB add constraint FK2_FOR_BEJB_1XM_UNI_BTOB  Foreign Key (FK2_FOR_BEJB_1XM_UNI_BTOB) references BEJB_1XM_UNI_BTOB(id)ON DELETE CASCADE;

ALTER TABLE BEANEJB_1XM_UNI_BTOB add constraint FK3_FOR_BEJB_1XM_UNI_BTOB  Foreign Key (FK3_FOR_BEJB_1XM_UNI_BTOB) references BEJB_1XM_UNI_BTOB(id)ON DELETE CASCADE;

ALTER TABLE BEANEJB_1XM_UNI_BTOB add constraint FK4_FOR_BEJB_1XM_UNI_BTOB  Foreign Key (FK4_FOR_BEJB_1XM_UNI_BTOB) references BEJB_1XM_UNI_BTOB(id)ON DELETE CASCADE;

ALTER TABLE BEJB_1XM_UNI_BTOB add constraint FK_FOR_AEJB_1XM_UNI_BTOB  Foreign Key (FK_FOR_AEJB_1XM_UNI_BTOB) references AEJB_1XM_UNI_BTOB(id)ON DELETE CASCADE;

DROP  table BEANEJB_MX1_UNI_BTOB cascade;
CREATE TABLE BEANEJB_MX1_UNI_BTOB   ( id VARCHAR(255)  PRIMARY KEY,      name VARCHAR(255) ,      value NUMBER NOT NULL,     FK1_FOR_AEJB_MX1_UNI_BTOB VARCHAR(255),     FK2_FOR_AEJB_MX1_UNI_BTOB VARCHAR(255),     FK1_FOR_BEJB_MX1_UNI_BTOB VARCHAR(255),     FK2_FOR_BEJB_MX1_UNI_BTOB VARCHAR(255),     FK3_FOR_BEJB_MX1_UNI_BTOB VARCHAR(255),     FK4_FOR_BEJB_MX1_UNI_BTOB VARCHAR(255));

DROP TABLE AEJB_MX1_UNI_BTOB cascade;
CREATE TABLE  AEJB_MX1_UNI_BTOB    ( id VARCHAR(255)  PRIMARY KEY,      name VARCHAR(255) ,      value NUMBER NOT NULL);

DROP table BEJB_MX1_UNI_BTOB cascade;
CREATE TABLE BEJB_MX1_UNI_BTOB    ( id  VARCHAR(255) PRIMARY KEY,      name VARCHAR(255),      value NUMBER NOT NULL,     FK_FOR_AEJB_MX1_UNI_BTOB VARCHAR(255));

ALTER TABLE BEANEJB_MX1_UNI_BTOB add constraint FK1_FOR_AEJB_MX1_UNI_BTOB  Foreign Key (FK1_FOR_AEJB_MX1_UNI_BTOB) references AEJB_MX1_UNI_BTOB(id)ON DELETE CASCADE;

ALTER TABLE BEANEJB_MX1_UNI_BTOB add constraint FK2_FOR_AEJB_MX1_UNI_BTOB  Foreign Key (FK2_FOR_AEJB_MX1_UNI_BTOB) references AEJB_MX1_UNI_BTOB(id)ON DELETE CASCADE;

ALTER TABLE BEANEJB_MX1_UNI_BTOB add constraint FK1_FOR_BEJB_MX1_UNI_BTOB  Foreign Key (FK1_FOR_BEJB_MX1_UNI_BTOB) references BEJB_MX1_UNI_BTOB(id)ON DELETE CASCADE;

ALTER TABLE BEANEJB_MX1_UNI_BTOB add constraint FK2_FOR_BEJB_MX1_UNI_BTOB  Foreign Key (FK2_FOR_BEJB_MX1_UNI_BTOB) references BEJB_MX1_UNI_BTOB(id)ON DELETE CASCADE;

ALTER TABLE BEANEJB_MX1_UNI_BTOB add constraint FK3_FOR_BEJB_MX1_UNI_BTOB  Foreign Key (FK3_FOR_BEJB_MX1_UNI_BTOB) references BEJB_MX1_UNI_BTOB(id)ON DELETE CASCADE;

ALTER TABLE BEANEJB_MX1_UNI_BTOB add constraint FK4_FOR_BEJB_MX1_UNI_BTOB  Foreign Key (FK4_FOR_BEJB_MX1_UNI_BTOB) references BEJB_MX1_UNI_BTOB(id)ON DELETE CASCADE;

ALTER TABLE BEJB_MX1_UNI_BTOB add constraint FK_FOR_AEJB_MX1_UNI_BTOB  Foreign Key (FK_FOR_AEJB_MX1_UNI_BTOB) references AEJB_MX1_UNI_BTOB(id)ON DELETE CASCADE;

DROP  table BEANEJB_MX1_UNI_DELETE cascade;
CREATE TABLE BEANEJB_MX1_UNI_DELETE   ( id VARCHAR(255)  PRIMARY KEY,      name VARCHAR(255) ,      value NUMBER NOT NULL,     FK1_FOR_AEJB_MX1_UNI_DELETE VARCHAR(255) ,     FK2_FOR_AEJB_MX1_UNI_DELETE VARCHAR(255) ,     FK1_FOR_BEJB_MX1_UNI_DELETE VARCHAR(255) ,     FK2_FOR_BEJB_MX1_UNI_DELETE VARCHAR(255) ,     FK3_FOR_BEJB_MX1_UNI_DELETE VARCHAR(255) ,     FK4_FOR_BEJB_MX1_UNI_DELETE VARCHAR(255) );

DROP table AEJB_MX1_UNI_DELETE cascade;
CREATE TABLE  AEJB_MX1_UNI_DELETE    ( id VARCHAR(255)  PRIMARY KEY,      name VARCHAR(255) ,      value NUMBER NOT NULL);

DROP table BEJB_MX1_UNI_DELETE cascade;
CREATE TABLE BEJB_MX1_UNI_DELETE    ( id  VARCHAR(255) PRIMARY KEY,      name VARCHAR(255),      value NUMBER NOT NULL,     FK_FOR_AEJB_MX1_UNI_DELETE VARCHAR(255));

ALTER TABLE BEANEJB_MX1_UNI_DELETE add constraint FK1_FOR_AEJB_MX1_UNI_DELETE  Foreign Key (FK1_FOR_AEJB_MX1_UNI_DELETE) references AEJB_MX1_UNI_DELETE(id);

ALTER TABLE BEANEJB_MX1_UNI_DELETE add constraint FK2_FOR_AEJB_MX1_UNI_DELETE  Foreign Key (FK2_FOR_AEJB_MX1_UNI_DELETE) references AEJB_MX1_UNI_DELETE(id);

ALTER TABLE BEANEJB_MX1_UNI_DELETE add constraint FK1_FOR_BEJB_MX1_UNI_DELETE  Foreign Key (FK1_FOR_BEJB_MX1_UNI_DELETE) references BEJB_MX1_UNI_DELETE(id);

ALTER TABLE BEANEJB_MX1_UNI_DELETE add constraint FK2_FOR_BEJB_MX1_UNI_DELETE Foreign Key (FK2_FOR_BEJB_MX1_UNI_DELETE) references BEJB_MX1_UNI_DELETE(id);

ALTER TABLE BEANEJB_MX1_UNI_DELETE add constraint FK3_FOR_BEJB_MX1_UNI_DELETE Foreign Key (FK3_FOR_BEJB_MX1_UNI_DELETE) references BEJB_MX1_UNI_DELETE(id);

ALTER TABLE BEANEJB_MX1_UNI_DELETE add constraint FK4_FOR_BEJB_MX1_UNI_DELETE Foreign Key (FK4_FOR_BEJB_MX1_UNI_DELETE) references BEJB_MX1_UNI_DELETE(id);

ALTER TABLE BEJB_MX1_UNI_DELETE add constraint FK_FOR_AEJB_MX1_UNI_DELETE Foreign Key (FK_FOR_AEJB_MX1_UNI_DELETE) references AEJB_MX1_UNI_DELETE(id);

DROP  table BEANEJB_MXM_BI_BTOB cascade;
CREATE TABLE BEANEJB_MXM_BI_BTOB   ( id VARCHAR(255)  PRIMARY KEY,      name VARCHAR(255) ,      value NUMBER NOT NULL,     FK1_FOR_AEJB_MXM_BI_BTOB VARCHAR(255) ,     FK2_FOR_AEJB_MXM_BI_BTOB VARCHAR(255) ,     FK3_FOR_AEJB_MXM_BI_BTOB VARCHAR(255) ,     FK4_FOR_AEJB_MXM_BI_BTOB VARCHAR(255) ,     FK1_FOR_BEJB_MXM_BI_BTOB VARCHAR(255) ,     FK2_FOR_BEJB_MXM_BI_BTOB VARCHAR(255) ,     FK3_FOR_BEJB_MXM_BI_BTOB VARCHAR(255) ,     FK4_FOR_BEJB_MXM_BI_BTOB VARCHAR(255) );

DROP table AEJB_MXM_BI_BTOB cascade;
CREATE TABLE  AEJB_MXM_BI_BTOB    ( id VARCHAR(255)  PRIMARY KEY,      name VARCHAR(255) ,      value NUMBER NOT NULL);

DROP table BEJB_MXM_BI_BTOB cascade;
CREATE TABLE BEJB_MXM_BI_BTOB    ( id  VARCHAR(255) PRIMARY KEY,      name VARCHAR(255),      value NUMBER NOT NULL );

DROP table FKEYS_MXM_BI_BTOB cascade;
CREATE TABLE FKEYS_MXM_BI_BTOB    ( FK_FOR_AEJB_MXM_BI_BTOB  VARCHAR(255),     FK_FOR_BEJB_MXM_BI_BTOB  VARCHAR(255));

ALTER TABLE BEANEJB_MXM_BI_BTOB add constraint FK1_FOR_AEJB_MXM_BI_BTOB Foreign Key (FK1_FOR_AEJB_MXM_BI_BTOB) references AEJB_MXM_BI_BTOB(id)ON DELETE CASCADE;

ALTER TABLE BEANEJB_MXM_BI_BTOB add constraint FK2_FOR_AEJB_MXM_BI_BTOB Foreign Key (FK2_FOR_AEJB_MXM_BI_BTOB) references AEJB_MXM_BI_BTOB(id)ON DELETE CASCADE;

ALTER TABLE BEANEJB_MXM_BI_BTOB add constraint FK3_FOR_AEJB_MXM_BI_BTOB Foreign Key (FK3_FOR_AEJB_MXM_BI_BTOB) references AEJB_MXM_BI_BTOB(id)ON DELETE CASCADE;

ALTER TABLE BEANEJB_MXM_BI_BTOB add constraint FK4_FOR_AEJB_MXM_BI_BTOB Foreign Key (FK4_FOR_AEJB_MXM_BI_BTOB) references AEJB_MXM_BI_BTOB(id)ON DELETE CASCADE;

ALTER TABLE BEANEJB_MXM_BI_BTOB add constraint FK1_FOR_BEJB_MXM_BI_BTOB Foreign Key (FK1_FOR_BEJB_MXM_BI_BTOB) references BEJB_MXM_BI_BTOB(id)ON DELETE CASCADE;

ALTER TABLE BEANEJB_MXM_BI_BTOB add constraint FK2_FOR_BEJB_MXM_BI_BTOB Foreign Key (FK2_FOR_BEJB_MXM_BI_BTOB) references BEJB_MXM_BI_BTOB(id)ON DELETE CASCADE;

ALTER TABLE BEANEJB_MXM_BI_BTOB add constraint FK3_FOR_BEJB_MXM_BI_BTOB Foreign Key (FK3_FOR_BEJB_MXM_BI_BTOB) references BEJB_MXM_BI_BTOB(id)ON DELETE CASCADE;

ALTER TABLE BEANEJB_MXM_BI_BTOB add constraint FK4_FOR_BEJB_MXM_BI_BTOB Foreign Key (FK4_FOR_BEJB_MXM_BI_BTOB) references BEJB_MXM_BI_BTOB(id)ON DELETE CASCADE;

ALTER TABLE FKEYS_MXM_BI_BTOB add constraint FK_FOR_AEJB_MXM_BI_BTOB Foreign Key (FK_FOR_AEJB_MXM_BI_BTOB) references AEJB_MXM_BI_BTOB(id)ON DELETE CASCADE;

ALTER TABLE FKEYS_MXM_BI_BTOB add constraint FK_FOR_BEJB_MXM_BI_BTOB Foreign Key (FK_FOR_BEJB_MXM_BI_BTOB) references BEJB_MXM_BI_BTOB(id)ON DELETE CASCADE;

DROP  table BEANEJB_MXM_BI_DELETE cascade;
CREATE TABLE BEANEJB_MXM_BI_DELETE   ( id VARCHAR(255)  PRIMARY KEY,      name VARCHAR(255) ,      value NUMBER NOT NULL,     FK1_FOR_AEJB_MXM_BI_DELETE VARCHAR(255) ,     FK2_FOR_AEJB_MXM_BI_DELETE VARCHAR(255) ,     FK3_FOR_AEJB_MXM_BI_DELETE VARCHAR(255) ,     FK4_FOR_AEJB_MXM_BI_DELETE VARCHAR(255) ,     FK1_FOR_BEJB_MXM_BI_DELETE VARCHAR(255) ,     FK2_FOR_BEJB_MXM_BI_DELETE VARCHAR(255) ,     FK3_FOR_BEJB_MXM_BI_DELETE VARCHAR(255) ,     FK4_FOR_BEJB_MXM_BI_DELETE VARCHAR(255) );

DROP table AEJB_MXM_BI_DELETE cascade;
CREATE TABLE  AEJB_MXM_BI_DELETE    ( id VARCHAR(255)  PRIMARY KEY,      name VARCHAR(255) ,      value NUMBER NOT NULL);

DROP table BEJB_MXM_BI_DELETE cascade;
CREATE TABLE BEJB_MXM_BI_DELETE    ( id  VARCHAR(255) PRIMARY KEY,      name VARCHAR(255),      value NUMBER NOT NULL );

DROP table FKEYS_MXM_BI_DELETE cascade;
CREATE TABLE FKEYS_MXM_BI_DELETE    ( FK_FOR_AEJB_MXM_BI_DELETE  VARCHAR(255),     FK_FOR_BEJB_MXM_BI_DELETE  VARCHAR(255));

ALTER TABLE BEANEJB_MXM_BI_DELETE add constraint FK1_FOR_AEJB_MXM_BI_DELETE Foreign Key (FK1_FOR_AEJB_MXM_BI_DELETE) references AEJB_MXM_BI_DELETE(id);

ALTER TABLE BEANEJB_MXM_BI_DELETE add constraint FK2_FOR_AEJB_MXM_BI_DELETE Foreign Key (FK2_FOR_AEJB_MXM_BI_DELETE) references AEJB_MXM_BI_DELETE(id);

ALTER TABLE BEANEJB_MXM_BI_DELETE add constraint FK3_FOR_AEJB_MXM_BI_DELETE Foreign Key (FK3_FOR_AEJB_MXM_BI_DELETE) references AEJB_MXM_BI_DELETE(id);

ALTER TABLE BEANEJB_MXM_BI_DELETE add constraint FK4_FOR_AEJB_MXM_BI_DELETE Foreign Key (FK4_FOR_AEJB_MXM_BI_DELETE) references AEJB_MXM_BI_DELETE(id);

ALTER TABLE BEANEJB_MXM_BI_DELETE add constraint FK1_FOR_BEJB_MXM_BI_DELETE Foreign Key (FK1_FOR_BEJB_MXM_BI_DELETE) references BEJB_MXM_BI_DELETE(id);

ALTER TABLE BEANEJB_MXM_BI_DELETE add constraint FK2_FOR_BEJB_MXM_BI_DELETE Foreign Key (FK2_FOR_BEJB_MXM_BI_DELETE) references BEJB_MXM_BI_DELETE(id);

ALTER TABLE BEANEJB_MXM_BI_DELETE add constraint FK3_FOR_BEJB_MXM_BI_DELETE Foreign Key (FK3_FOR_BEJB_MXM_BI_DELETE) references BEJB_MXM_BI_DELETE(id);

ALTER TABLE BEANEJB_MXM_BI_DELETE add constraint FK4_FOR_BEJB_MXM_BI_DELETE Foreign Key (FK4_FOR_BEJB_MXM_BI_DELETE) references BEJB_MXM_BI_DELETE(id);

ALTER TABLE FKEYS_MXM_BI_DELETE add constraint FK_FOR_AEJB_MXM_BI_DELETE Foreign Key (FK_FOR_AEJB_MXM_BI_DELETE) references AEJB_MXM_BI_DELETE(id);

ALTER TABLE FKEYS_MXM_BI_DELETE add constraint FK_FOR_BEJB_MXM_BI_DELETE Foreign Key (FK_FOR_BEJB_MXM_BI_DELETE) references BEJB_MXM_BI_DELETE(id);

DROP  table BEANEJB_MXM_UNI_BTOB cascade;
CREATE TABLE BEANEJB_MXM_UNI_BTOB   ( id VARCHAR(255)  PRIMARY KEY,      name VARCHAR(255) ,      value NUMBER NOT NULL,     FK1_FOR_AEJB_MXM_UNI_BTOB VARCHAR(255) ,     FK2_FOR_AEJB_MXM_UNI_BTOB VARCHAR(255) ,     FK3_FOR_AEJB_MXM_UNI_BTOB VARCHAR(255) ,     FK4_FOR_AEJB_MXM_UNI_BTOB VARCHAR(255) ,     FK1_FOR_BEJB_MXM_UNI_BTOB VARCHAR(255) ,     FK2_FOR_BEJB_MXM_UNI_BTOB VARCHAR(255) ,     FK3_FOR_BEJB_MXM_UNI_BTOB VARCHAR(255) ,     FK4_FOR_BEJB_MXM_UNI_BTOB VARCHAR(255) );

DROP table AEJB_MXM_UNI_BTOB cascade;
CREATE TABLE  AEJB_MXM_UNI_BTOB    ( id VARCHAR(255)  PRIMARY KEY,      name VARCHAR(255) ,      value NUMBER NOT NULL);

DROP table BEJB_MXM_UNI_BTOB cascade;
CREATE TABLE BEJB_MXM_UNI_BTOB    ( id  VARCHAR(255) PRIMARY KEY,      name VARCHAR(255),      value NUMBER NOT NULL );

DROP table FKEYS_MXM_UNI_BTOB cascade;
CREATE TABLE FKEYS_MXM_UNI_BTOB    ( FK_FOR_AEJB_MXM_UNI_BTOB  VARCHAR(255),     FK_FOR_BEJB_MXM_UNI_BTOB  VARCHAR(255));

ALTER TABLE BEANEJB_MXM_UNI_BTOB add constraint FK1_FOR_AEJB_MXM_UNI_BTOB Foreign Key (FK1_FOR_AEJB_MXM_UNI_BTOB) references AEJB_MXM_UNI_BTOB(id)ON DELETE CASCADE;

ALTER TABLE BEANEJB_MXM_UNI_BTOB add constraint FK2_FOR_AEJB_MXM_UNI_BTOB Foreign Key (FK2_FOR_AEJB_MXM_UNI_BTOB) references AEJB_MXM_UNI_BTOB(id)ON DELETE CASCADE;

ALTER TABLE BEANEJB_MXM_UNI_BTOB add constraint FK3_FOR_AEJB_MXM_UNI_BTOB Foreign Key (FK3_FOR_AEJB_MXM_UNI_BTOB) references AEJB_MXM_UNI_BTOB(id)ON DELETE CASCADE;

ALTER TABLE BEANEJB_MXM_UNI_BTOB add constraint FK4_FOR_AEJB_MXM_UNI_BTOB Foreign Key (FK4_FOR_AEJB_MXM_UNI_BTOB) references AEJB_MXM_UNI_BTOB(id)ON DELETE CASCADE;

ALTER TABLE BEANEJB_MXM_UNI_BTOB add constraint FK1_FOR_BEJB_MXM_UNI_BTOB Foreign Key (FK1_FOR_BEJB_MXM_UNI_BTOB) references BEJB_MXM_UNI_BTOB(id)ON DELETE CASCADE;

ALTER TABLE BEANEJB_MXM_UNI_BTOB add constraint FK2_FOR_BEJB_MXM_UNI_BTOB Foreign Key (FK2_FOR_BEJB_MXM_UNI_BTOB) references BEJB_MXM_UNI_BTOB(id)ON DELETE CASCADE;

ALTER TABLE BEANEJB_MXM_UNI_BTOB add constraint FK3_FOR_BEJB_MXM_UNI_BTOB Foreign Key (FK3_FOR_BEJB_MXM_UNI_BTOB) references BEJB_MXM_UNI_BTOB(id)ON DELETE CASCADE;

ALTER TABLE BEANEJB_MXM_UNI_BTOB add constraint FK4_FOR_BEJB_MXM_UNI_BTOB Foreign Key (FK4_FOR_BEJB_MXM_UNI_BTOB) references BEJB_MXM_UNI_BTOB(id)ON DELETE CASCADE;

ALTER TABLE FKEYS_MXM_UNI_BTOB add constraint FK_FOR_AEJB_MXM_UNI_BTOB Foreign Key (FK_FOR_AEJB_MXM_UNI_BTOB) references AEJB_MXM_UNI_BTOB(id)ON DELETE CASCADE;

ALTER TABLE FKEYS_MXM_UNI_BTOB add constraint FK_FOR_BEJB_MXM_UNI_BTOB Foreign Key (FK_FOR_BEJB_MXM_UNI_BTOB) references BEJB_MXM_UNI_BTOB(id)ON DELETE CASCADE;

DROP  table BEANEJB_1X1_UNI_BTOB cascade;
CREATE TABLE BEANEJB_1X1_UNI_BTOB ( id VARCHAR(255)  PRIMARY KEY,      name VARCHAR(255) ,      value NUMBER NOT NULL,     FK1_FOR_AEJB_1X1_UNI_BTOB VARCHAR(255),     FK2_FOR_AEJB_1X1_UNI_BTOB VARCHAR(255),     FK1_FOR_BEJB_1X1_UNI_BTOB VARCHAR(255),     FK2_FOR_BEJB_1X1_UNI_BTOB VARCHAR(255));

DROP table AEJB_1X1_UNI_BTOB cascade;
CREATE TABLE  AEJB_1X1_UNI_BTOB ( id VARCHAR(255)  PRIMARY KEY,      name VARCHAR(255) ,      value NUMBER NOT NULL);

DROP table BEJB_1X1_UNI_BTOB cascade;
CREATE TABLE BEJB_1X1_UNI_BTOB ( id  VARCHAR(255) PRIMARY KEY,      name VARCHAR(255),      value NUMBER NOT NULL,     FK_FOR_AEJB_1X1_UNI_BTOB VARCHAR(255));

ALTER TABLE BEANEJB_1X1_UNI_BTOB add constraint FK1_FOR_AEJB_1X1_UNI_BTOB  Foreign Key (FK1_FOR_AEJB_1X1_UNI_BTOB) references AEJB_1X1_UNI_BTOB(id)ON DELETE CASCADE;

ALTER TABLE BEANEJB_1X1_UNI_BTOB add constraint FK2_FOR_AEJB_1X1_UNI_BTOB  Foreign Key (FK2_FOR_AEJB_1X1_UNI_BTOB) references AEJB_1X1_UNI_BTOB(id)ON DELETE CASCADE;

ALTER TABLE BEANEJB_1X1_UNI_BTOB add constraint FK1_FOR_BEJB_1X1_UNI_BTOB  Foreign Key (FK1_FOR_BEJB_1X1_UNI_BTOB) references BEJB_1X1_UNI_BTOB(id)ON DELETE CASCADE;

ALTER TABLE BEANEJB_1X1_UNI_BTOB add constraint FK2_FOR_BEJB_1X1_UNI_BTOB  Foreign Key (FK2_FOR_BEJB_1X1_UNI_BTOB) references BEJB_1X1_UNI_BTOB(id)ON DELETE CASCADE;

ALTER TABLE BEJB_1X1_UNI_BTOB add constraint FK_FOR_AEJB_1X1_UNI_BTOB  Foreign Key (FK_FOR_AEJB_1X1_UNI_BTOB) references AEJB_1X1_UNI_BTOB(id)ON DELETE CASCADE;

DROP  table BEANEJB_1XM_BI_BTOB cascade;
CREATE TABLE BEANEJB_1XM_BI_BTOB ( id VARCHAR(255)  PRIMARY KEY,      name VARCHAR(255) ,      value NUMBER NOT NULL,     FK1_FOR_AEJB_1XM_BI_BTOB VARCHAR(255),     FK2_FOR_AEJB_1XM_BI_BTOB VARCHAR(255),     FK1_FOR_BEJB_1XM_BI_BTOB VARCHAR(255),     FK2_FOR_BEJB_1XM_BI_BTOB VARCHAR(255),     FK3_FOR_BEJB_1XM_BI_BTOB VARCHAR(255),     FK4_FOR_BEJB_1XM_BI_BTOB VARCHAR(255));

DROP table AEJB_1XM_BI_BTOB cascade;
CREATE TABLE  AEJB_1XM_BI_BTOB ( id VARCHAR(255)  PRIMARY KEY,      name VARCHAR(255) ,      value NUMBER NOT NULL);

DROP table BEJB_1XM_BI_BTOB cascade;
CREATE TABLE BEJB_1XM_BI_BTOB ( id  VARCHAR(255) PRIMARY KEY,      name VARCHAR(255),      value NUMBER NOT NULL,     FK_FOR_AEJB_1XM_BI_BTOB VARCHAR(255));

ALTER TABLE BEANEJB_1XM_BI_BTOB add constraint FK1_FOR_AEJB_1XM_BI_BTOB  Foreign Key (FK1_FOR_AEJB_1XM_BI_BTOB) references AEJB_1XM_BI_BTOB(id)ON DELETE CASCADE;

ALTER TABLE BEANEJB_1XM_BI_BTOB add constraint FK2_FOR_AEJB_1XM_BI_BTOB Foreign Key (FK2_FOR_AEJB_1XM_BI_BTOB) references AEJB_1XM_BI_BTOB(id)ON DELETE CASCADE;

ALTER TABLE BEANEJB_1XM_BI_BTOB add constraint FK1_FOR_BEJB_1XM_BI_BTOB Foreign Key (FK1_FOR_BEJB_1XM_BI_BTOB) references BEJB_1XM_BI_BTOB(id)ON DELETE CASCADE;

ALTER TABLE BEANEJB_1XM_BI_BTOB add constraint FK2_FOR_BEJB_1XM_BI_BTOB Foreign Key (FK2_FOR_BEJB_1XM_BI_BTOB) references BEJB_1XM_BI_BTOB(id)ON DELETE CASCADE;

ALTER TABLE BEANEJB_1XM_BI_BTOB add constraint FK3_FOR_BEJB_1XM_BI_BTOB Foreign Key (FK3_FOR_BEJB_1XM_BI_BTOB) references BEJB_1XM_BI_BTOB(id)ON DELETE CASCADE;

ALTER TABLE BEANEJB_1XM_BI_BTOB add constraint FK4_FOR_BEJB_1XM_BI_BTOB Foreign Key (FK4_FOR_BEJB_1XM_BI_BTOB) references BEJB_1XM_BI_BTOB(id)ON DELETE CASCADE;

ALTER TABLE BEJB_1XM_BI_BTOB add constraint FK_FOR_AEJB_1XM_BI_BTOB Foreign Key (FK_FOR_AEJB_1XM_BI_BTOB) references AEJB_1XM_BI_BTOB(id)ON DELETE CASCADE;

DROP  table BEANEJB_1XM_BI_CASCADE cascade;
CREATE TABLE BEANEJB_1XM_BI_CASCADE ( id VARCHAR(255)  PRIMARY KEY,      name VARCHAR(255) ,      value NUMBER NOT NULL,     FK1_FOR_AEJB_1XM_BI_CASCADE VARCHAR(255),     FK2_FOR_AEJB_1XM_BI_CASCADE VARCHAR(255),     FK1_FOR_BEJB_1XM_BI_CASCADE VARCHAR(255),     FK2_FOR_BEJB_1XM_BI_CASCADE VARCHAR(255));

DROP table AEJB_1XM_BI_CASCADE cascade;
CREATE TABLE  AEJB_1XM_BI_CASCADE ( id VARCHAR(255)  PRIMARY KEY,      name VARCHAR(255) ,      value NUMBER NOT NULL);

DROP table BEJB_1XM_BI_CASCADE cascade;
CREATE TABLE BEJB_1XM_BI_CASCADE ( id  VARCHAR(255) PRIMARY KEY,      name VARCHAR(255),      value NUMBER NOT NULL,     FK_FOR_AEJB_1XM_BI_CASCADE VARCHAR(255));

ALTER TABLE BEANEJB_1XM_BI_CASCADE add constraint FK1_FOR_AEJB_1XM_BI_CASCADE Foreign Key (FK1_FOR_AEJB_1XM_BI_CASCADE) references AEJB_1XM_BI_CASCADE(id);

ALTER TABLE BEANEJB_1XM_BI_CASCADE add constraint FK2_FOR_AEJB_1XM_BI_CASCADE Foreign Key (FK2_FOR_AEJB_1XM_BI_CASCADE) references AEJB_1XM_BI_CASCADE(id);

ALTER TABLE BEANEJB_1XM_BI_CASCADE add constraint FK1_FOR_BEJB_1XM_BI_CASCADE Foreign Key (FK1_FOR_BEJB_1XM_BI_CASCADE) references BEJB_1XM_BI_CASCADE(id);

ALTER TABLE BEANEJB_1XM_BI_CASCADE add constraint FK2_FOR_BEJB_1XM_BI_CASCADE Foreign Key (FK2_FOR_BEJB_1XM_BI_CASCADE) references BEJB_1XM_BI_CASCADE(id);

ALTER TABLE BEJB_1XM_BI_CASCADE add constraint FK_FOR_AEJB_1XM_BI_CASCADE Foreign Key (FK_FOR_AEJB_1XM_BI_CASCADE) references AEJB_1XM_BI_CASCADE(id);


DROP TABLE EMPLOYEE cascade;
CREATE TABLE EMPLOYEE (ID INTEGER PRIMARY KEY NOT NULL, FIRSTNAME VARCHAR(255) , LASTNAME VARCHAR(255), HIREDATE DATE, SALARY REAL NOT NULL,  STATUS VARCHAR(255) , FK_MGR INTEGER, FK_DEPT INTEGER, FK_PROJECT INTEGER , FK_INS INTEGER) ;



DROP TABLE DEPARTMENT cascade;
CREATE TABLE DEPARTMENT (NAME VARCHAR(255) , ID INTEGER PRIMARY KEY NOT NULL, COMPANY_COMPANYID INTEGER ) ;

DROP TABLE INSURANCE cascade;
CREATE TABLE INSURANCE (INSID INTEGER PRIMARY KEY NOT NULL, CARRIER VARCHAR(255) ) ;

DROP TABLE COFFEE cascade;
CREATE TABLE COFFEE (ID INTEGER PRIMARY KEY NOT NULL, BRANDNAME VARCHAR(25), PRICE REAL);

DROP TABLE COMPANY cascade ;
CREATE TABLE COMPANY (COMPANYID INTEGER PRIMARY KEY NOT NULL, NAME VARCHAR(25), ADDRESS_ID VARCHAR(255) );

DROP TABLE TEAM cascade ;
CREATE TABLE TEAM (NAME VARCHAR(255) NOT NULL, TEAMID INTEGER PRIMARY KEY NOT NULL,  COMPANY_COMPANYID INTEGER);

ALTER TABLE TEAM ADD CONSTRAINT COMPANY_COMPANYID FOREIGN KEY (COMPANY_COMPANYID) REFERENCES COMPANY(COMPANYID) ON DELETE CASCADE ;
ALTER TABLE COMPANY ADD CONSTRAINT FK_ADDRESS FOREIGN KEY (ADDRESS_ID) REFERENCES ADDRESS(ID) ON DELETE CASCADE;

ALTER TABLE DEPARTMENT ADD CONSTRAINT FK_COMPANY FOREIGN KEY (COMPANY_COMPANYID) REFERENCES COMPANY(COMPANYID) ON DELETE CASCADE ;

DROP TABLE PROJECT cascade;
CREATE TABLE PROJECT (PROJID INTEGER PRIMARY KEY NOT NULL, NAME VARCHAR(25), BUDGET DECIMAL(18,0));

DROP TABLE PERSON  cascade;
CREATE TABLE PERSON (PERSONID INTEGER NOT NULL, FIRSTNAME VARCHAR(255) , LASTNAME VARCHAR(255) , PROJECT_PROJID INTEGER , INSURANCE_INSID INTEGER , TEAM_TEAMID INTEGER , CONSTRAINT PK_PERSON PRIMARY KEY (PERSONID)) ;

DROP TABLE ANNUALREVIEW ;
CREATE TABLE ANNUALREVIEW (AID INTEGER NOT NULL, SERVICE INTEGER, CONSTRAINT PK_ANNUAL PRIMARY KEY (AID));

DROP TABLE PROJECT_PERSON cascade;
CREATE TABLE PROJECT_PERSON (PROJECTS_PROJID INTEGER , PERSONS_PERSONID INTEGER );

DROP TABLE PERSON_INSURANCE cascade;
CREATE TABLE PERSON_INSURANCE (PERSON_PERSONID INTEGER, INSURANCE_INSID INTEGER );

DROP TABLE PERSON_ANNUALREVIEW cascade;
CREATE TABLE PERSON_ANNUALREVIEW (PERSON_PERSONID INTEGER, ANNUALREVIEWS_AID INTEGER );

ALTER TABLE EMPLOYEE ADD CONSTRAINT FK_MGR FOREIGN KEY (FK_MGR) REFERENCES EMPLOYEE(ID) ON DELETE CASCADE;
ALTER TABLE EMPLOYEE ADD CONSTRAINT FK_DEPT FOREIGN KEY (FK_DEPT) REFERENCES DEPARTMENT(ID) ON DELETE CASCADE;
ALTER TABLE EMPLOYEE ADD CONSTRAINT FK_PROJECT FOREIGN KEY (FK_PROJECT) REFERENCES PROJECT(PROJID) ON DELETE CASCADE ;
ALTER TABLE EMPLOYEE ADD CONSTRAINT FK_INS FOREIGN KEY (FK_INS) REFERENCES INSURANCE(INSID) ON DELETE CASCADE ;

ALTER TABLE PERSON ADD CONSTRAINT TEAM_TEAMID FOREIGN KEY (TEAM_TEAMID) REFERENCES TEAM(TEAMID) ON DELETE CASCADE;
ALTER TABLE PERSON ADD CONSTRAINT PROJECT_PROJID FOREIGN KEY (PROJECT_PROJID) REFERENCES PROJECT(PROJID) ON DELETE CASCADE;

ALTER TABLE PROJECT_PERSON ADD CONSTRAINT PROJECTS_PROJID Foreign Key (PROJECTS_PROJID) references PROJECT(PROJID) ON DELETE CASCADE;
ALTER TABLE PROJECT_PERSON ADD CONSTRAINT PERSONS_PERSONID Foreign Key (PERSONS_PERSONID) references PERSON(PERSONID) ON DELETE CASCADE;

ALTER TABLE PERSON_ANNUALREVIEW ADD CONSTRAINT ANNUALREVIEWS_AID Foreign Key (ANNUALREVIEWS_AID) references ANNUALREVIEW(AID) ON DELETE CASCADE;
ALTER TABLE PERSON_ANNUALREVIEW ADD CONSTRAINT PERSON_PERSONID Foreign Key (PERSON_PERSONID) references PERSON(PERSONID) ON DELETE CASCADE;

ALTER TABLE PERSON_INSURANCE ADD CONSTRAINT P_PERSONID Foreign Key (PERSON_PERSONID) references PERSON(PERSONID) ON DELETE CASCADE;
ALTER TABLE PERSON_INSURANCE  ADD CONSTRAINT INS_INSID Foreign Key (INSURANCE_INSID) references INSURANCE(INSID) ON DELETE CASCADE;

DROP TABLE PKEY cascade;
CREATE TABLE PKEY ( PMIDINTEGER INTEGER  NOT NULL, PMIDSTRING VARCHAR(25) NOT NULL, PMIDFLOAT REAL NOT NULL, BRANDNAME VARCHAR(25) , PRICE REAL, constraint PKEY PRIMARY KEY(PMIDINTEGER,PMIDSTRING,PMIDFLOAT) );

DROP TABLE DATATYPES cascade;
CREATE TABLE DATATYPES ( BOOLEANDATA SMALLINT, CHARDATA CHAR, SHORTDATA SMALLINT, INTDATA INTEGER, INTDATA2 INTEGER, LONGDATA BIGINT, DBLDATA DOUBLE, FLOATDATA FLOAT, ID INTEGER PRIMARY KEY NOT NULL, ENUMODATA INTEGER, ENUMSDATA VARCHAR(25), BYTEDATA SMALLINT, TRANS SMALLINT);

DROP TABLE DATATYPES2 cascade;
CREATE TABLE DATATYPES2 ( DATATYPES2_ID TIMESTAMP PRIMARY KEY NOT NULL, TIMEDATA TIMESTAMP, TSDATA TIMESTAMP, BYTEDATA BLOB(9072), CHARDATA VARCHAR(448)) ;

DROP TABLE GENERATOR_TABLE cascade ;
CREATE TABLE GENERATOR_TABLE (PK_COL VARCHAR2(10) PRIMARY KEY NOT NULL, VAL_COL INTEGER );
INSERT into GENERATOR_TABLE(PK_COL, VAL_COL) values ('DT_ID', 1) ;

DROP TABLE SEQUENCE;
CREATE TABLE SEQUENCE (SEQ_NAME VARCHAR2(10) PRIMARY KEY NOT NULL, SEQ_COUNT INTEGER );
INSERT into SEQUENCE(SEQ_NAME, SEQ_COUNT) values ('SEQ_GEN', 0) ;

DROP TABLE PURCHASE_ORDER cascade;
CREATE TABLE PURCHASE_ORDER (ID INTEGER PRIMARY KEY NOT NULL, TOTAL INTEGER, DESCRIPTION VARCHAR(50));

DROP TABLE ORDER1 cascade;
CREATE TABLE ORDER1 (ID INTEGER PRIMARY KEY NOT NULL, TOTALPRICE DOUBLE , FK1_FOR_ITEM INTEGER);
 
DROP TABLE ORDER2 cascade;
CREATE TABLE ORDER2 (ID INTEGER PRIMARY KEY NOT NULL, TOTALPRICE DOUBLE , FK2_FOR_ITEM INTEGER);

DROP TABLE ORDER3 cascade;
CREATE TABLE ORDER3 (ID INTEGER PRIMARY KEY NOT NULL, TOTALPRICE DOUBLE , FK3_FOR_ITEM INTEGER);

DROP TABLE ITEM ;
CREATE TABLE ITEM (ID INTEGER PRIMARY KEY NOT NULL, ITEMNAME VARCHAR2(255)) ;

ALTER TABLE ORDER1 add constraint FK1_FOR_ITEM Foreign Key (FK1_FOR_ITEM) references ITEM(ID) ;
ALTER TABLE ORDER2 add constraint FK2_FOR_ITEM Foreign Key (FK2_FOR_ITEM) references ITEM(ID) ;
ALTER TABLE ORDER3 add constraint FK3_FOR_ITEM Foreign Key (FK3_FOR_ITEM) references ITEM(ID) ;

DROP TABLE MEMBER cascade ; 
CREATE TABLE MEMBER (MEMBER_ID INTEGER NOT NULL PRIMARY KEY, MEMBER_NAME VARCHAR(255), DUES SMALLINT NULL, VERSION INTEGER, DONATION NUMBER) ;

DROP TABLE ACCOUNT cascade ;
CREATE TABLE ACCOUNT (ID INTEGER NOT NULL PRIMARY KEY, BALANCE DOUBLE , DEPOSIT DOUBLE , WITHDRAW DOUBLE ) ;







DROP TABLE PARTTIMEEMPLOYEE  cascade ;
CREATE TABLE PARTTIMEEMPLOYEE (ID INT NOT NULL, FIRSTNAME VARCHAR(255) , LASTNAME VARCHAR(255), HIREDATE DATE, SALARY REAL NOT NULL,  ADDRESS_ID VARCHAR(255), STATUS VARCHAR(255), FK_DEPT2 INTEGER , FK_PROJECT INT, CONSTRAINT PK_PARTTIMEEMPLOYEE PRIMARY KEY (ID)) ;
ALTER TABLE PARTTIMEEMPLOYEE ADD CONSTRAINT FK_ADDR FOREIGN KEY (ADDRESS_ID) REFERENCES ADDRESS(ID) ;

ALTER TABLE PARTTIMEEMPLOYEE ADD CONSTRAINT FK_DEPT2 FOREIGN KEY (FK_DEPT2) REFERENCES DEPARTMENT (ID) ;

DROP TABLE A_BASIC  cascade ;
CREATE TABLE A_BASIC ( ID VARCHAR(255)   PRIMARY KEY NOT NULL, NAME VARCHAR(255) , VALUE INT, BASICINTEGER INT, BASICSHORT SMALLINT, BASICBIGSHORT SMALLINT, BASICFLOAT REAL, BASICBIGFLOAT REAL, BASICLONG BIGINT, BASICBIGLONG BIGINT, BASICDOUBLE DOUBLE PRECISION, BASICBIGDOUBLE DOUBLE PRECISION, BASICCHAR CHAR, BASICCHARARRAY VARCHAR(448), BASICBIGCHARARRAY VARCHAR(448), BASICBYTEARRAY   LONGVARBINARY(48000), BASICBIGBYTEARRAY  LONGVARBINARY(48000), BASICBIGINTEGER DECIMAL(18,0), BASICBIGDECIMAL DECIMAL(18,0), BASICDATE DATE, BASICTIME TIME, BASICCALENDAR DATE, BASICTIMESTAMP TIMESTAMP ) ;

DROP TABLE A_BIGINTEGER  cascade ;
CREATE TABLE A_BIGINTEGER ( ID VARCHAR(255), NAME VARCHAR(255) , VALUE INT, BASICINTEGER INT, BASICSHORT SMALLINT, BASICBIGSHORT SMALLINT, BASICFLOAT REAL, BASICBIGFLOAT REAL, BASICLONG BIGINT, BASICBIGLONG BIGINT, BASICDOUBLE DOUBLE PRECISION, BASICBIGDOUBLE DOUBLE PRECISION, BASICCHAR CHAR, BASICCHARARRAY VARCHAR(448), BASICBIGCHARARRAY VARCHAR(448), BASICBYTEARRAY   LONGVARBINARY(48000), BASICBIGBYTEARRAY  LONGVARBINARY(48000), BASICBIGINTEGER DECIMAL(18,0) PRIMARY KEY NOT NULL, BASICBIGDECIMAL DECIMAL(18,0), BASICDATE DATE, BASICTIME TIME, BASICCALENDAR DATE, BASICTIMESTAMP TIMESTAMP ) ;

DROP TABLE A_BIGDECIMAL  cascade ;
CREATE TABLE A_BIGDECIMAL ( ID VARCHAR(255), NAME VARCHAR(255) , VALUE INT, BASICINTEGER INT, BASICSHORT SMALLINT, BASICBIGSHORT SMALLINT, BASICFLOAT REAL, BASICBIGFLOAT REAL, BASICLONG BIGINT, BASICBIGLONG BIGINT, BASICDOUBLE DOUBLE PRECISION, BASICBIGDOUBLE DOUBLE PRECISION, BASICCHAR CHAR, BASICCHARARRAY VARCHAR(448), BASICBIGCHARARRAY VARCHAR(448), BASICBYTEARRAY   LONGVARBINARY(48000), BASICBIGBYTEARRAY  LONGVARBINARY(48000), BASICBIGINTEGER DECIMAL(18,0), BASICBIGDECIMAL DECIMAL(18,0) PRIMARY KEY NOT NULL, BASICDATE DATE, BASICTIME TIME, BASICCALENDAR DATE, BASICTIMESTAMP TIMESTAMP );

DROP TABLE BNE_1XM_BI_BTOB  cascade ;
CREATE TABLE BNE_1XM_BI_BTOB ( ID VARCHAR(255)   PRIMARY KEY NOT NULL, NAME VARCHAR(255) , VALUE DECIMAL(18,0) NOT NULL, STREET VARCHAR(255), CITY VARCHAR(255), STATE VARCHAR(255), ZIP VARCHAR(255), PLUSFOUR VARCHAR(255), FK_FOR_ANE_1XM_BI_BTOB VARCHAR(255) ) ;

DROP TABLE B_EMBEDDABLE  cascade ;
CREATE TABLE B_EMBEDDABLE ( ID VARCHAR(255)   PRIMARY KEY NOT NULL, NAME VARCHAR(255) , VALUE DECIMAL(18,0) NOT NULL, STREET VARCHAR(255), CITY VARCHAR(255), STATE VARCHAR(255), ZIP VARCHAR(255), PLUSFOUR VARCHAR(255)) ;

DROP TABLE MEMBER  cascade ;
CREATE TABLE MEMBER (MEMBER_ID INT NOT NULL, MEMBER_NAME VARCHAR(255), DUES SMALLINT, VERSION INT, DONATION DECIMAL(18,0), CONSTRAINT PK_MEMBER PRIMARY KEY (MEMBER_ID));

DROP TABLE ACCOUNT  cascade ;
CREATE TABLE ACCOUNT (ID INT NOT NULL, BALANCE DOUBLE PRECISION, DEPOSIT DOUBLE PRECISION, WITHDRAW DOUBLE PRECISION, CONSTRAINT PK_ACCOUNT PRIMARY KEY (ID));

DROP TABLE SEMESTER cascade ;
CREATE TABLE SEMESTER (ID INTEGER NOT NULL, PRIMARY KEY (ID));

DROP TABLE STUDENT_COURSE cascade ;
CREATE TABLE STUDENT_COURSE (Student_ID INTEGER NOT NULL, courses_ID INTEGER NOT NULL, PRIMARY KEY (Student_ID, courses_ID));

DROP TABLE STUDENT cascade ;
CREATE TABLE STUDENT (ID INTEGER NOT NULL, STUDENTNAME VARCHAR(255), PRIMARY KEY (ID));

DROP TABLE COURSE cascade ;
CREATE TABLE COURSE (ID INTEGER NOT NULL, COURSENAME VARCHAR(255), PRIMARY KEY (ID));

DROP TABLE ENROLLMENTS cascade ;
CREATE TABLE ENROLLMENTS (STUDENT INTEGER NOT NULL, ENROLLMENT_KEY INTEGER NOT NULL, SEMESTER INTEGER NOT NULL, PRIMARY KEY (STUDENT, ENROLLMENT_KEY, SEMESTER));

DROP TABLE COURSE_STUDENT cascade ;
CREATE TABLE COURSE_STUDENT (COURSE_ID INTEGER NOT NULL, STUDENT_ID INTEGER NOT NULL, STUDENTS_ORDER INTEGER, PRIMARY KEY (COURSE_ID , STUDENT_ID));

ALTER TABLE STUDENT_COURSE ADD CONSTRAINT STDNTCOURSEStdntID FOREIGN KEY (Student_ID) REFERENCES STUDENT (ID);
ALTER TABLE STUDENT_COURSE ADD CONSTRAINT STDNTCOURSEcrsesID FOREIGN KEY (courses_ID) REFERENCES COURSE (ID);
ALTER TABLE ENROLLMENTS ADD CONSTRAINT ENROLLMENTSSTUDENT FOREIGN KEY (STUDENT) REFERENCES STUDENT (ID);
ALTER TABLE ENROLLMENTS ADD CONSTRAINT NROLLMENTSSEMESTER FOREIGN KEY (SEMESTER) REFERENCES SEMESTER (ID);
ALTER TABLE COURSE_STUDENT ADD CONSTRAINT CRSESTUDENTCurseID FOREIGN KEY (COURSE_ID) REFERENCES COURSE (ID);
ALTER TABLE COURSE_STUDENT ADD CONSTRAINT CRSSTUDENTstdntsID FOREIGN KEY (STUDENT_ID) REFERENCES STUDENT (ID);

DROP TABLE NOENTITYLISTENER_TABLE  cascade ;
CREATE TABLE NOENTITYLISTENER_TABLE(ID BIGINT  PRIMARY KEY NOT NULL) ;

DROP TABLE COURSE_2  cascade ;
CREATE TABLE COURSE_2(ID BIGINT NOT NULL,NAME VARCHAR(255)) ;

DROP TABLE STUDENT_2  cascade ;
CREATE TABLE STUDENT_2(ID BIGINT NOT NULL,NAME VARCHAR(255)) ;

DROP TABLE STUDENT_2_COURSE_2  cascade ;
CREATE TABLE STUDENT_2_COURSE_2(COURSES_ID BIGINT,STUDENTS_ID BIGINT) ;

DROP TABLE NAMEONLYINXML  cascade ;
CREATE TABLE NAMEONLYINXML(ID BIGINT) ;

DROP TABLE NAMEONLYINANNOTATION  cascade ;
CREATE TABLE NAMEONLYINANNOTATION(ID BIGINT) ;

DROP TABLE NAMEOVERRIDE  cascade ;
CREATE TABLE NAMEOVERRIDE (ID BIGINT) ;

DROP TABLE NOENTITYANNOTATION  cascade ;
CREATE TABLE  NOENTITYANNOTATION(ID BIGINT) ;

DROP TABLE BOOKSTORE  cascade ;
CREATE TABLE BOOKSTORE(ID BIGINT NOT NULL,NAME VARCHAR(255),LOCATION VARCHAR(255)) ;

DROP TABLE COMPLAINT  cascade ;
CREATE TABLE COMPLAINT(ID BIGINT NOT NULL, COMPLAINTNUMBER INT, NAME VARCHAR(255), ADDRESS VARCHAR(255)) ;

DROP TABLE MOVIETICKET  cascade ;
CREATE TABLE MOVIETICKET(ID BIGINT NOT NULL, FILMNAME VARCHAR(255), FILMCODE VARCHAR(255)) ;

DROP TABLE BOOK  cascade ;
CREATE TABLE BOOK(ID BIGINT NOT NULL, NAME VARCHAR(255), STATEOFUSA VARCHAR(255)) ;

DROP TABLE LAWBOOK  cascade ;
CREATE TABLE LAWBOOK(ID BIGINT NOT NULL, BOOK_NAME VARCHAR(255), CATEGORY VARCHAR(255),PUBLISHER VARCHAR(255),COST INT) ;

DROP TABLE EMPLOYEE_2  cascade ;
CREATE TABLE EMPLOYEE_2(ID BIGINT NOT NULL, CODE  VARCHAR(255), DEPARTMENT_ID BIGINT) ;

DROP TABLE DEPARTMENT_2  cascade ;
CREATE TABLE DEPARTMENT_2(ID BIGINT NOT NULL,NAME  VARCHAR(255)) ;

DROP TABLE THEATRELOCATION  cascade ;
CREATE TABLE THEATRELOCATION(ID BIGINT NOT NULL, CODE  VARCHAR(255)) ;

DROP TABLE THEATRECOMPANY  cascade ;
CREATE TABLE THEATRECOMPANY(ID BIGINT NOT NULL,NAME  VARCHAR(255)) ;

DROP TABLE THEATRELOCATION_THEATRECOMPANY  cascade ;
CREATE TABLE THEATRELOCATION_THEATRECOMPANY(COMPANIES_ID BIGINT, LOCATIONS_ID BIGINT) ;

DROP TABLE STORE  cascade ;
CREATE TABLE STORE(ID BIGINT NOT NULL, NAME VARCHAR(255)) ;

DROP TABLE CUSTOMERS  cascade ;
CREATE TABLE CUSTOMERS(ID BIGINT NOT NULL, CUSTNAME VARCHAR(255), STORE_ID BIGINT) ;

DROP TABLE CONSUMER  cascade ;
CREATE TABLE CONSUMER(ID BIGINT NOT NULL) ;

DROP TABLE RETAILORDER  cascade ;
CREATE TABLE RETAILORDER(ID BIGINT NOT NULL, COST DOUBLE PRECISION) ;

DROP TABLE RETAILORDER_CONSUMER  cascade ;
CREATE TABLE RETAILORDER_CONSUMER(CONSUMERS_ID  BIGINT NOT NULL,ORDERS_ID  BIGINT NOT NULL) ;

DROP TABLE THEATRELOCATION1  cascade ;
CREATE TABLE THEATRELOCATION1(ID BIGINT NOT NULL, CODE  VARCHAR(255),TCOMP_ID BIGINT) ;

DROP TABLE THEATRECOMPANY1  cascade ;
CREATE TABLE THEATRECOMPANY1(ID BIGINT NOT NULL,NAME  VARCHAR(255)) ;

DROP TABLE CUBICLE  cascade ;
CREATE TABLE CUBICLE(ID BIGINT NOT NULL , LOCATION VARCHAR(255), PRIMARY KEY(ID,LOCATION)) ;

DROP TABLE HARDWARE  cascade ;
CREATE TABLE HARDWARE(ID BIGINT NOT NULL, CODE VARCHAR(255),CUBE_ID BIGINT NOT NULL, CUBE_LOCATION VARCHAR(255)) ;

DROP TABLE CUSTOMER1  cascade ;
CREATE TABLE CUSTOMER1(ID BIGINT NOT NULL, NAME VARCHAR(255), CONSTRAINT PK_CUSTOMER1 PRIMARY KEY (ID)) ;

DROP TABLE RETAILORDER1  cascade ;
CREATE  TABLE RETAILORDER1(ID BIGINT NOT NULL, COST DOUBLE PRECISION) ;

DROP TABLE CUST_ORDER  cascade ;
CREATE TABLE  CUST_ORDER(CUSTID BIGINT NOT NULL,ORDERID BIGINT NOT NULL) ;


DROP TABLE RETAILORDER2  cascade ;
CREATE  TABLE RETAILORDER2(ID BIGINT NOT NULL, COST DOUBLE PRECISION, FK_FOR_CUSTOMER1 BIGINT ) ;

ALTER TABLE RETAILORDER2 ADD CONSTRAINT FK_FOR_CUST FOREIGN KEY(FK_FOR_CUSTOMER1) REFERENCES CUSTOMER1(ID) ;

ALTER TABLE UNI1X1PERSON drop constraint  N1X1PRSNPRJCTPRJID ;
DROP TABLE UNI1X1PROJECT  cascade ;
DROP TABLE UNI1X1PERSON  cascade ;


CREATE TABLE UNI1X1PROJECT (PROJID BIGINT NOT NULL, BUDGET REAL, NAME VARCHAR(255), PRIMARY KEY (PROJID)) ;
CREATE TABLE UNI1X1PERSON (ID BIGINT NOT NULL, NAME VARCHAR(255), PROJECT_PROJID BIGINT, PRIMARY KEY (ID)) ;
ALTER TABLE UNI1X1PERSON ADD CONSTRAINT N1X1PRSNPRJCTPRJID FOREIGN KEY (PROJECT_PROJID) REFERENCES UNI1X1PROJECT (PROJID) ;


ALTER TABLE UNI1XMPERSON_UNI1XMPROJECT drop constraint N1XMPRSNNn1XMPrsnD ;
ALTER TABLE UNI1XMPERSON_UNI1XMPROJECT drop constraint  N1XMPRSNN1XprjctsD ;
DROP TABLE UNI1XMPERSON_UNI1XMPROJECT  cascade ;
DROP TABLE UNI1XMPROJECT  cascade ;
DROP TABLE UNI1XMPERSON  cascade ;

CREATE TABLE UNI1XMPERSON_UNI1XMPROJECT (Uni1XMPerson_ID BIGINT NOT NULL, projects_ID BIGINT NOT NULL, PRIMARY KEY (Uni1XMPerson_ID, projects_ID)) ;
CREATE TABLE UNI1XMPROJECT (ID BIGINT NOT NULL, NAME VARCHAR(255), BUDGET REAL, PRIMARY KEY (ID)) ;
CREATE TABLE UNI1XMPERSON (ID BIGINT NOT NULL, NAME VARCHAR(255), PRIMARY KEY (ID)) ;
ALTER TABLE UNI1XMPERSON_UNI1XMPROJECT ADD CONSTRAINT N1XMPRSNNn1XMPrsnD FOREIGN KEY (Uni1XMPerson_ID) REFERENCES UNI1XMPERSON (ID) ;
ALTER TABLE UNI1XMPERSON_UNI1XMPROJECT ADD CONSTRAINT N1XMPRSNN1XprjctsD FOREIGN KEY (projects_ID) REFERENCES UNI1XMPROJECT (ID) ;


ALTER TABLE UNIMX1PERSON drop constraint  NMX1PRSNNMX1PRJCTD ;
DROP TABLE UNIMX1PROJECT  cascade ;
DROP TABLE UNIMX1PERSON  cascade ;

CREATE TABLE UNIMX1PROJECT (ID BIGINT NOT NULL, NAME VARCHAR(255), BUDGET REAL, PRIMARY KEY (ID)) ;
CREATE TABLE UNIMX1PERSON (ID BIGINT NOT NULL, NAME VARCHAR(255), UNIMX1PROJECT_ID BIGINT, PRIMARY KEY (ID)) ;
ALTER TABLE UNIMX1PERSON ADD CONSTRAINT NMX1PRSNNMX1PRJCTD FOREIGN KEY (UNIMX1PROJECT_ID) REFERENCES UNIMX1PROJECT (ID) ;


ALTER TABLE UNIMXMPERSON_UNIMXMPROJECT drop constraint  NMXMPRSNNnMXMPrsnD ;
ALTER TABLE UNIMXMPERSON_UNIMXMPROJECT drop constraint  NMXMPRSNnMXMPrjctD ;
DROP TABLE UNIMXMPERSON  cascade ;
DROP TABLE UNIMXMPROJECT  cascade ;
DROP TABLE UNIMXMPERSON_UNIMXMPROJECT  cascade ;

CREATE TABLE UNIMXMPERSON (ID BIGINT NOT NULL, NAME VARCHAR(255), PRIMARY KEY (ID)) ;
CREATE TABLE UNIMXMPROJECT (ID BIGINT NOT NULL, NAME VARCHAR(255), BUDGET REAL, PRIMARY KEY (ID)) ;
CREATE TABLE UNIMXMPERSON_UNIMXMPROJECT (UniMXMPerson_ID BIGINT NOT NULL, UniMXMProject_ID BIGINT NOT NULL, PRIMARY KEY (UniMXMPerson_ID, UniMXMProject_ID)) ;
ALTER TABLE UNIMXMPERSON_UNIMXMPROJECT ADD CONSTRAINT NMXMPRSNNnMXMPrsnD FOREIGN KEY (UniMXMPerson_ID) REFERENCES UNIMXMPERSON (ID) ;
ALTER TABLE UNIMXMPERSON_UNIMXMPROJECT ADD CONSTRAINT NMXMPRSNnMXMPrjctD FOREIGN KEY (UniMXMProject_ID) REFERENCES UNIMXMPROJECT (ID) ;


ALTER TABLE BIDIR1X1PERSON drop constraint  BDR1X1PRSPRJCTPRJD ;
DROP TABLE BIDIR1X1PERSON  cascade ;
DROP TABLE BIDIR1X1PROJECT  cascade ;

CREATE TABLE BIDIR1X1PERSON (ID BIGINT NOT NULL, NAME VARCHAR(255), PROJECT_PROJID BIGINT, PRIMARY KEY (ID)) ;
CREATE TABLE BIDIR1X1PROJECT (PROJID BIGINT NOT NULL, BUDGET REAL, NAME VARCHAR(255), PRIMARY KEY (PROJID)) ;
ALTER TABLE BIDIR1X1PERSON ADD CONSTRAINT BDR1X1PRSPRJCTPRJD FOREIGN KEY (PROJECT_PROJID) REFERENCES BIDIR1X1PROJECT (PROJID) ;


ALTER TABLE BIDIR1XMPROJECT drop constraint  BDR1XMPBDR1XMPRSND ;
DROP TABLE BIDIR1XMPERSON  cascade ;
DROP TABLE BIDIR1XMPROJECT  cascade ;

CREATE TABLE BIDIR1XMPERSON (ID BIGINT NOT NULL, NAME VARCHAR(255), PRIMARY KEY (ID)) ;
CREATE TABLE BIDIR1XMPROJECT (ID BIGINT NOT NULL, NAME VARCHAR(255), BUDGET REAL, BIDIR1XMPERSON_ID BIGINT, PRIMARY KEY (ID)) ;
ALTER TABLE BIDIR1XMPROJECT ADD CONSTRAINT BDR1XMPBDR1XMPRSND FOREIGN KEY (BIDIR1XMPERSON_ID) REFERENCES BIDIR1XMPERSON (ID) ;


ALTER TABLE BIDIRMX1PERSON drop constraint  BDRMX1PRNMX1PRJCTD ;
DROP TABLE BIDIRMX1PROJECT  cascade ;
DROP TABLE BIDIRMX1PERSON  cascade ;

CREATE TABLE BIDIRMX1PROJECT (ID BIGINT NOT NULL, NAME VARCHAR(255), BUDGET REAL, PRIMARY KEY (ID)) ;
CREATE TABLE BIDIRMX1PERSON (ID BIGINT NOT NULL, NAME VARCHAR(255), UNIMX1PROJECT_ID BIGINT, PRIMARY KEY (ID)) ;
ALTER TABLE BIDIRMX1PERSON ADD CONSTRAINT BDRMX1PRNMX1PRJCTD FOREIGN KEY (UNIMX1PROJECT_ID) REFERENCES BIDIRMX1PROJECT (ID) ;


ALTER TABLE BIDIRMXMPERSON_BIDIRMXMPROJECT drop constraint  BDRMXMPBDRMXMPrsnD ;
ALTER TABLE BIDIRMXMPERSON_BIDIRMXMPROJECT drop constraint  BDRMXMBDRMXMPrjctD ;
DROP TABLE BIDIRMXMPERSON_BIDIRMXMPROJECT  cascade ;
DROP TABLE BIDIRMXMPERSON  cascade ;
DROP TABLE BIDIRMXMPROJECT  cascade ;

CREATE TABLE BIDIRMXMPERSON_BIDIRMXMPROJECT (BIDIRMXMPerson_ID BIGINT NOT NULL, BIDIRMXMProject_ID BIGINT NOT NULL, PRIMARY KEY (BIDIRMXMPerson_ID, BIDIRMXMProject_ID)) ;
CREATE TABLE BIDIRMXMPERSON (ID BIGINT NOT NULL, NAME VARCHAR(255), PRIMARY KEY (ID)) ;
CREATE TABLE BIDIRMXMPROJECT (ID BIGINT NOT NULL, NAME VARCHAR(255), BUDGET REAL, PRIMARY KEY (ID)) ;
ALTER TABLE BIDIRMXMPERSON_BIDIRMXMPROJECT ADD CONSTRAINT BDRMXMPBDRMXMPrsnD FOREIGN KEY (BIDIRMXMPerson_ID) REFERENCES BIDIRMXMPERSON (ID) ;
ALTER TABLE BIDIRMXMPERSON_BIDIRMXMPROJECT ADD CONSTRAINT BDRMXMBDRMXMPrjctD FOREIGN KEY (BIDIRMXMProject_ID) REFERENCES BIDIRMXMPROJECT (ID) ;


ALTER TABLE DID1DEPENDENT drop constraint  DID1DEPENDENTEMPID ;
DROP TABLE DID1DEPENDENT  cascade ;
DROP TABLE DID1EMPLOYEE  cascade ;

CREATE TABLE DID1DEPENDENT (NAME VARCHAR(255) NOT NULL, EMP_ID BIGINT NOT NULL, PRIMARY KEY (NAME, EMP_ID)) ;
CREATE TABLE DID1EMPLOYEE (ID BIGINT NOT NULL, NAME VARCHAR(255), PRIMARY KEY (ID)) ;
ALTER TABLE DID1DEPENDENT ADD CONSTRAINT DID1DEPENDENTEMPID FOREIGN KEY (EMP_ID) REFERENCES DID1EMPLOYEE (ID) ;


ALTER TABLE DID1BDEPENDENT drop constraint  DID1BDEPENDENTMPID ;
DROP TABLE DID1BDEPENDENT  cascade ;
DROP TABLE DID1BEMPLOYEE  cascade ;

CREATE TABLE DID1BDEPENDENT (NAME VARCHAR(255) NOT NULL, EMP_ID BIGINT NOT NULL, PRIMARY KEY (NAME, EMP_ID)) ;
CREATE TABLE DID1BEMPLOYEE (ID BIGINT NOT NULL, NAME VARCHAR(255), PRIMARY KEY (ID)) ;
ALTER TABLE DID1BDEPENDENT ADD CONSTRAINT DID1BDEPENDENTMPID FOREIGN KEY (EMP_ID) REFERENCES DID1BEMPLOYEE (ID) ;


ALTER TABLE DID2DEPENDENT drop constraint  DD2DPENDENTFRSTNME ;
DROP TABLE DID2EMPLOYEE  cascade ;
DROP TABLE DID2DEPENDENT  cascade ;

CREATE TABLE DID2EMPLOYEE (FIRSTNAME VARCHAR(255) NOT NULL, LASTNAME VARCHAR(255) NOT NULL, EMPNO INTEGER, PRIMARY KEY (FIRSTNAME, LASTNAME)) ;
CREATE TABLE DID2DEPENDENT (NAME VARCHAR(255) NOT NULL, FIRSTNAME VARCHAR(255) NOT NULL, LASTNAME VARCHAR(255) NOT NULL, PRIMARY KEY (NAME, FIRSTNAME, LASTNAME)) ;
ALTER TABLE DID2DEPENDENT ADD CONSTRAINT DD2DPENDENTFRSTNME FOREIGN KEY (FIRSTNAME, LASTNAME) REFERENCES DID2EMPLOYEE (FIRSTNAME, LASTNAME) ;


ALTER TABLE DID2BDEPENDENT drop constraint  DD2BDPENDENTLSTNME ;
DROP TABLE DID2BEMPLOYEE  cascade ;
DROP TABLE DID2BDEPENDENT  cascade ;

CREATE TABLE DID2BEMPLOYEE (LASTNAME VARCHAR(255) NOT NULL, FIRSTNAME VARCHAR(255) NOT NULL, EMPNO INTEGER, PRIMARY KEY (LASTNAME, FIRSTNAME)) ;
CREATE TABLE DID2BDEPENDENT (NAME VARCHAR(255) NOT NULL, LASTNAME VARCHAR(255) NOT NULL, FIRSTNAME VARCHAR(255) NOT NULL, PRIMARY KEY (NAME, LASTNAME, FIRSTNAME)) ;
ALTER TABLE DID2BDEPENDENT ADD CONSTRAINT DD2BDPENDENTLSTNME FOREIGN KEY (LASTNAME, FIRSTNAME) REFERENCES DID2BEMPLOYEE (LASTNAME, FIRSTNAME) ;


ALTER TABLE DID3DEPENDENT drop constraint  DD3DPENDENTFRSTNME ;
DROP TABLE DID3EMPLOYEE  cascade ;
DROP TABLE DID3DEPENDENT  cascade ;

CREATE TABLE DID3EMPLOYEE (FIRSTNAME VARCHAR(255) NOT NULL, LASTNAME VARCHAR(255) NOT NULL, PRIMARY KEY (FIRSTNAME, LASTNAME)) ;
CREATE TABLE DID3DEPENDENT (NAME VARCHAR(255) NOT NULL, FIRSTNAME VARCHAR(255) NOT NULL, LASTNAME VARCHAR(255) NOT NULL, PRIMARY KEY (NAME, FIRSTNAME, LASTNAME)) ;
ALTER TABLE DID3DEPENDENT ADD CONSTRAINT DD3DPENDENTFRSTNME FOREIGN KEY (FIRSTNAME, LASTNAME) REFERENCES DID3EMPLOYEE (FIRSTNAME, LASTNAME) ;


ALTER TABLE DID3BDEPENDENT drop constraint  DD3BDPENDENTLSTNME ;
DROP TABLE DID3BEMPLOYEE  cascade ;
DROP TABLE DID3BDEPENDENT  cascade ;

CREATE TABLE DID3BEMPLOYEE (LASTNAME VARCHAR(255) NOT NULL, FIRSTNAME VARCHAR(255) NOT NULL, PRIMARY KEY (LASTNAME, FIRSTNAME)) ;
CREATE TABLE DID3BDEPENDENT (NAME VARCHAR(255) NOT NULL, LASTNAME VARCHAR(255) NOT NULL, FIRSTNAME VARCHAR(255) NOT NULL, PRIMARY KEY (NAME, LASTNAME, FIRSTNAME)) ;
ALTER TABLE DID3BDEPENDENT ADD CONSTRAINT DD3BDPENDENTLSTNME FOREIGN KEY (LASTNAME, FIRSTNAME) REFERENCES DID3BEMPLOYEE (LASTNAME, FIRSTNAME) ;


ALTER TABLE DID4MEDICALHISTORY drop constraint  DD4MDCLHSTRPTNTSSN ;
DROP TABLE DID4MEDICALHISTORY  cascade ;
DROP TABLE DID4PERSON  cascade ;

CREATE TABLE DID4MEDICALHISTORY (DOCTORNAME VARCHAR(255), PATIENT_SSN VARCHAR(255) NOT NULL, PRIMARY KEY (PATIENT_SSN)) ;
CREATE TABLE DID4PERSON (SSN VARCHAR(255) NOT NULL, NAME VARCHAR(255), PRIMARY KEY (SSN)) ;
ALTER TABLE DID4MEDICALHISTORY ADD CONSTRAINT DD4MDCLHSTRPTNTSSN FOREIGN KEY (PATIENT_SSN) REFERENCES DID4PERSON (SSN) ;


ALTER TABLE DID4BMEDICALHISTORY drop constraint  DD4BMDCLHSTPTNTSSN ;
DROP TABLE DID4BMEDICALHISTORY  cascade ;
DROP TABLE DID4BPERSON  cascade ;

CREATE TABLE DID4BMEDICALHISTORY (ID VARCHAR(255) NOT NULL, DOCTORNAME VARCHAR(255), PRIMARY KEY (ID)) ;
CREATE TABLE DID4BPERSON (SSN VARCHAR(255) NOT NULL, NAME VARCHAR(255), PRIMARY KEY (SSN)) ;
ALTER TABLE DID4BMEDICALHISTORY ADD CONSTRAINT DD4BMDCLHSTPTNTSSN FOREIGN KEY (ID) REFERENCES DID4BPERSON (SSN) ;

ALTER TABLE DID5MEDICALHISTORY drop constraint  DD5MDCLHSTRYFRSTNM ;
DROP TABLE DID5PERSON  cascade ;
DROP TABLE DID5MEDICALHISTORY  cascade ;

CREATE TABLE DID5PERSON (FIRSTNAME VARCHAR(255) NOT NULL, LASTNAME VARCHAR(255) NOT NULL, SSN VARCHAR(255), PRIMARY KEY (FIRSTNAME, LASTNAME)) ;
CREATE TABLE DID5MEDICALHISTORY (DOCTORNAME VARCHAR(255), FIRSTNAME VARCHAR(255) NOT NULL, LASTNAME VARCHAR(255) NOT NULL, PRIMARY KEY (FIRSTNAME, LASTNAME)) ;
ALTER TABLE DID5MEDICALHISTORY ADD CONSTRAINT DD5MDCLHSTRYFRSTNM FOREIGN KEY (FIRSTNAME, LASTNAME) REFERENCES DID5PERSON (FIRSTNAME, LASTNAME) ;


ALTER TABLE DID5BMEDICALHISTORY drop constraint  DD5BMDCLHSTRYLSTNM ;
DROP TABLE DID5BMEDICALHISTORY  cascade ;
DROP TABLE DID5BPERSON  cascade ;

CREATE TABLE DID5BMEDICALHISTORY (DOCTORNAME VARCHAR(255), LASTNAME VARCHAR(255) NOT NULL, FIRSTNAME VARCHAR(255) NOT NULL, PRIMARY KEY (LASTNAME, FIRSTNAME)) ;
CREATE TABLE DID5BPERSON (LASTNAME VARCHAR(255) NOT NULL, FIRSTNAME VARCHAR(255) NOT NULL, SSN VARCHAR(255), PRIMARY KEY (LASTNAME, FIRSTNAME)) ;
ALTER TABLE DID5BMEDICALHISTORY ADD CONSTRAINT DD5BMDCLHSTRYLSTNM FOREIGN KEY (LASTNAME, FIRSTNAME) REFERENCES DID5BPERSON (LASTNAME, FIRSTNAME) ;


ALTER TABLE DID6MEDICALHISTORY drop constraint  DD6MDCLHSTRYFRSTNM ;
DROP TABLE DID6MEDICALHISTORY  cascade ;
DROP TABLE DID6PERSON  cascade ;

CREATE TABLE DID6MEDICALHISTORY (DOCTORNAME VARCHAR(255), FIRSTNAME VARCHAR(255) NOT NULL, LASTNAME VARCHAR(255) NOT NULL, PRIMARY KEY (FIRSTNAME, LASTNAME)) ;
CREATE TABLE DID6PERSON (SSN VARCHAR(255), FIRSTNAME VARCHAR(255) NOT NULL, LASTNAME VARCHAR(255) NOT NULL, PRIMARY KEY (FIRSTNAME, LASTNAME)) ;
ALTER TABLE DID6MEDICALHISTORY ADD CONSTRAINT DD6MDCLHSTRYFRSTNM FOREIGN KEY (FIRSTNAME, LASTNAME) REFERENCES DID6PERSON (FIRSTNAME, LASTNAME) ;

ALTER TABLE DID6BMEDICALHISTORY drop constraint  DD6BMDCLHSTRYLSTNM ;
DROP TABLE DID6BPERSON  cascade ;
DROP TABLE DID6BMEDICALHISTORY  cascade ;

CREATE TABLE DID6BPERSON (SSN VARCHAR(255), LASTNAME VARCHAR(255) NOT NULL, FIRSTNAME VARCHAR(255) NOT NULL, PRIMARY KEY (LASTNAME, FIRSTNAME)) ;
CREATE TABLE DID6BMEDICALHISTORY (DOCTORNAME VARCHAR(255), LASTNAME VARCHAR(255) NOT NULL, FIRSTNAME VARCHAR(255) NOT NULL, PRIMARY KEY (LASTNAME, FIRSTNAME)) ;
ALTER TABLE DID6BMEDICALHISTORY ADD CONSTRAINT DD6BMDCLHSTRYLSTNM FOREIGN KEY (LASTNAME, FIRSTNAME) REFERENCES DID6BPERSON (LASTNAME, FIRSTNAME) ;

DROP TABLE A_ADDRESS  cascade ;
CREATE TABLE A_ADDRESS ( A_ID VARCHAR(255) NOT NULL,  STREET VARCHAR(30), CITY VARCHAR(30), STATE VARCHAR(2), ZIP VARCHAR(10) );

DROP TABLE COLTAB_ADDRESS  cascade ;
CREATE TABLE COLTAB_ADDRESS ( A_ID VARCHAR(255) NOT NULL,  STREET VARCHAR(30), CITY VARCHAR(30), STATE VARCHAR(2), ZIP VARCHAR(10) );

DROP TABLE AEC  cascade ;
CREATE TABLE AEC ( ID VARCHAR(255)   PRIMARY KEY NOT NULL, NAME VARCHAR(255) , VALUE DECIMAL(18,0) ) ;

DROP TABLE COLTAB  cascade ;
CREATE TABLE COLTAB ( ID VARCHAR(255)   PRIMARY KEY NOT NULL, NAME VARCHAR(255) , VALUE DECIMAL(18,0) ) ;

DROP TABLE ANE_1XM_BI_BTOB  cascade ;
CREATE TABLE ANE_1XM_BI_BTOB ( ID VARCHAR(255)   PRIMARY KEY NOT NULL, NAME VARCHAR(255) , VALUE DECIMAL(18,0) NOT NULL ) ;
ALTER TABLE BNE_1XM_BI_BTOB ADD CONSTRAINT FK_FOR_ANE_1XM_BI FOREIGN KEY (FK_FOR_ANE_1XM_BI_BTOB) REFERENCES ANE_1XM_BI_BTOB (ID) ;

ALTER TABLE COLTAB_EMP_EMBEDED_ADDRESS DROP CONSTRAINT FK_EMPEMBADDRID ;
DROP TABLE COLTAB_EMP_EMBEDED_ADDRESS;
DROP TABLE EMPLOYEE_EMBEDED_ADDRESS;
CREATE TABLE EMPLOYEE_EMBEDED_ADDRESS (ID INTEGER NOT NULL, FIRSTNAME VARCHAR(255), LASTNAME VARCHAR(255), PRIMARY KEY (ID));
CREATE TABLE COLTAB_EMP_EMBEDED_ADDRESS (ADDRESS_LOCATION VARCHAR(255), STREET VARCHAR(255), STATE VARCHAR(255), ZIP VARCHAR(255), CITY VARCHAR(255), ID VARCHAR(255), EMPEMBADDRID INTEGER);
ALTER TABLE COLTAB_EMP_EMBEDED_ADDRESS ADD CONSTRAINT FK_EMPEMBADDRID FOREIGN KEY (EMPEMBADDRID) REFERENCES EMPLOYEE_EMBEDED_ADDRESS (ID) ;

DROP TABLE EMP_MAPKEYCOL cascade;
CREATE TABLE EMP_MAPKEYCOL (ID INTEGER PRIMARY KEY NOT NULL, FIRSTNAME VARCHAR(255) , LASTNAME VARCHAR(255), HIREDATE DATE, SALARY REAL NOT NULL,  STATUS VARCHAR(255) , FK_MGR INTEGER, FK_DEPT INTEGER, FK_PROJECT INTEGER , FK_INS INTEGER, OFFICE_ID VARCHAR(255)) ;
ALTER TABLE EMP_MAPKEYCOL ADD CONSTRAINT FK_DEPT1 FOREIGN KEY (FK_DEPT) REFERENCES DEPARTMENT(ID) ON DELETE CASCADE;

DROP TABLE UUIDTYPE;
CREATE TABLE UUIDTYPE (ID VARCHAR(96) NOT NULL, NAME VARCHAR(255), PRIMARY KEY (ID));

DROP TABLE CRITERIA_TEST_COLTABLE;
DROP TABLE CRITERIA_TEST_TABLE;
CREATE TABLE CRITERIA_TEST_TABLE (ID INTEGER PRIMARY KEY NOT NULL, DATE_VAL DATE, INT_VAL INTEGER, STR_VAL_1 VARCHAR(255), STR_VAL_2 VARCHAR(255), TIME_VAL TIME);
CREATE TABLE CRITERIA_TEST_COLTABLE(ENT_ID INTEGER NOT NULL, COLVAL VARCHAR(255), CONSTRAINT FK_CRITERIA_TEST_COLTABLE_ENT_ID FOREIGN KEY (ENT_ID) REFERENCES CRITERIA_TEST_TABLE (ID));