可学答题网 > 问答 > IBM(000-730)题库
目录: 标题| 题干| 答案| 搜索| 相关
问题

Given the following requirements: Cre


Given the following requirements: Create a table to contain employee data, with a unique numeric identifier automatically assigned when a row is added, has an EDLEVEL column that permits only the values 'C', 'H' and 'N', and permits inserts only when a corresponding value for the employee's department exists in the DEPARTMENT table. Which of the following CREATE statements will successfully create this table?()

  • ACREATE TABLE emp ( empno SMALLINT NEXTVAL GENERATED ALWAYS AS IDENTITY, firstname VARCHAR(30) NOT NULL, lastname VARCHAR(30) NOT NULL, workdept CHAR(3) NOT NULL, edlevel CHAR(1), PRIMARY KEY emp_pk (empno), FOREIGN KEY emp_workdept_fk ON (workdept) REFERENCES department (deptno), CHECK edlevel_ck VALUES (edlevel IN ('C','H','N')), );
  • BCREATE TABLE emp ( empno SMALLINT NOT NULL GENERATED BY DEFAULT AS IDENTITY, firstname VARCHAR(30) NOT NULL, lastname VARCHAR(30) NOT NULL, workdept CHAR(3), edlevel CHAR(1), CONSTRAINT emp_pk PRIMARY KEY (empno), CONSTRAINT emp_workdept_fk FOREIGN KEY (workdept) REFERENCES department (deptno), CONSTRAINT edlevel_ck CHECK edlevel VALUES ('C','H','N') );
  • CCREATE TABLE emp ( empno SMALLINT NEXTVAL GENERATED BY DEFAULT AS IDENTITY, firstname VARCHAR(30) NOT NULL, lastname VARCHAR(30) NOT NULL, workdept CHAR(3) NOT NULL, edlevel CHAR(1) CHECK IN ('C','H','N')), CONSTRAINT emp_pk PRIMARY KEY (empno), CONSTRAINT emp_workdept_fk FOREIGN KEY department (deptno) REFERENCES (workdept) );
  • DCREATE TABLE emp ( empno SMALLINT NOT NULL GENERATED BY DEFAULT AS IDENTITY, firstname VARCHAR(30) NOT NULL, lastname VARCHAR(30) NOT NULL, workdept CHAR(3), edlevel CHAR(1), CONSTRAINT emp_pk PRIMARY KEY (empno), CONSTRAINT emp_workdept_fk FOREIGN KEY (workdept) REFERENCES department (deptno), CONSTRAINT edlevel_ck CHECK (edlevel IN ('C','H','N')) )
参考答案
参考解析:
分类:IBM(000-730)题库
相关推荐

1、Given the following 

Given the following output what course of action should be undertaken for a long ...

2、Given the following table definitions

Given the following table definitions:EMPLOYEEID NAME DEPTID01Smith 1002Bossy 2003 20Peterson04Goss 3005Pape 4006Avery 5007O'Neal 6008Carter 50DEPA...

3、Given the following steps, which woul

Given the following steps, which would be the correct order to create a backup of an Oracle database in NOARCHIVELOG mode?()1.shutdown immedia...

4、Given the following 

Given the following six method names:(1)addListener(2)addMouseListener (3)setMouseListener(4)deleteMouseListener(5)rem...

5、You have the following requirements i

You have the following requirements in relation to the detection of block corruption for your database instance:1. Check for logical self-consist...

6、Given the following ALTER SEQUENCE sta

Given the following ALTER SEQUENCE statement: ALTER SEQUENCE myseq RESTART WITH 0 INCREMENT BY 1 NO MAXVALUE CACHE 5 ORDER Assuming that the s...