CREATE TABLE QUESTIONARIO (
  NRQUESTIONARIO NUMBER(10) NOT NULL, 
  NRTIPOQUEST NUMBER(10) NOT NULL, 
  NMAPLICATIVO VARCHAR2(40) NOT NULL, 
  NMQUESTIONARIO VARCHAR2(100) NOT NULL, 
  NRORG NUMBER(10) DEFAULT 1 NOT NULL, 
  IDATIVO VARCHAR2(1) DEFAULT 'S' NOT NULL, 
  DTINCLUSAO DATE DEFAULT NULL NULL, 
  DTULTATU DATE DEFAULT NULL NULL, 
  NRORGINCLUSAO NUMBER(10) DEFAULT 1 NULL, 
  CDOPERINCLUSAO VARCHAR2(12) DEFAULT '1' NULL, 
  NRORGULTATU NUMBER(10) DEFAULT 1 NULL, 
  CDOPERULTATU VARCHAR2(12) DEFAULT '1' NULL,
  CONSTRAINT PK_QUESTIONARIO PRIMARY KEY(NRQUESTIONARIO)
)
/
ALTER TABLE QUESTIONARIO ADD CONSTRAINT CKC_NMAPLICATIVO_QUESTIONARIO CHECK (NMAPLICATIVO IN ('MYMENU','MYMUEST'))
/
ALTER TABLE QUESTIONARIO ADD CONSTRAINT CKC_IDATIVO_QUESTIONARIO CHECK (IDATIVO IN ('S','N'))