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)
);
答案 0 :(得分:2)
你可以尝试(你只做了一个简单的错误:参考后的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)
);
上看到它