2017-09-26 14 views
-2
CREATE TABLE XX_EMP_COL_CONST 
(
    EMP_ID NUMBER CONSTRAINT XX_EMP_COL_CONST_PK PRIMARY KEY, 
    ENAME VARCHAR2(100) CONSTRAINT XX_EMP_COL_CONST_UK1 UNIQUE, 
    SALARY NUMBER NOT NULL, 
    GENDER CHAR (1) CONSTRAINT XX_EMP_COL_CONST_CHQ CHECK (GENDER IN ('M','F')), 
    DEPT_ID NUMBER CONSTRAINT XX_EMP_COL_CONST_FK1 REFERENCE departments(department_id) 
); 

答えて

2

あなたは(あなただけの単純なミス行わ:REFERENCE後S):試すことができます

CREATE TABLE XX_EMP_COL_CONST (
    EMP_ID NUMBER CONSTRAINT XX_EMP_COL_CONST_PK PRIMARY KEY 
    ,ENAME VARCHAR2(100) CONSTRAINT XX_EMP_COL_CONST_UK1 UNIQUE 
    ,SALARY NUMBER NOT NULL 
    ,GENDER CHAR(1) CONSTRAINT XX_EMP_COL_CONST_CHQ CHECK (GENDER IN ('M', 'F')) 
    ,DEPT_ID NUMBER CONSTRAINT XX_EMP_COL_CONST_FK1 REFERENCES departments(department_id) 
    ); 

あなたはhttp://sqlfiddle.com/#!4/4e896f/1

上でそれを見ることができますが
関連する問題