CREATE TABLE MWL_DEINFO
(
   DEROWID varchar(64) NOT NULL,
   DATASETUUID varchar(64) NOT NULL,
   GROUPNUMBER int NOT NULL,
   ELEMENTNUMBER int NOT NULL,
   ISSQ smallint NOT NULL,
   PARENTSQUID varchar(64),
   VALUE varchar(64),
   SQUUID varchar(64),
   ITEMUUID varchar(64),
   DELEVEL int NOT NULL,
   DEVR int
)
;

CREATE TABLE MWL
(
   STEPID varchar(64) NOT NULL,
   DATASETUUID varchar(64) NOT NULL
);

ALTER TABLE MWL_DEINFO ADD 
	CONSTRAINT MWL_DEINFO_PK PRIMARY KEY 
	(
		DEROWID
	);

ALTER TABLE MWL ADD 
	CONSTRAINT MWL_PK PRIMARY KEY 
	(
		DATASETUUID
	);

ALTER TABLE MWL_DEINFO ADD 
	CONSTRAINT MWL_DEINFO_MWL_FK00 FOREIGN KEY 
	(
		DATASETUUID
	) REFERENCES MWL(
		DATASETUUID
	)on delete cascade;