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 cor

题目

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?()

A.CREATE 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‘)), );

B.CREATE 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‘) );

C.CREATE 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) );

D.CREATE 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‘)) );


相似考题
参考答案和解析
参考答案:D
更多“Given the following requirements:Create a table to contain employee data, with a unique nu ”相关问题
  • 第1题:

    包容类Contain和内嵌类Embed定义如下:includeclass Contain{private:int X;protect

    包容类Contain和内嵌类Embed定义如下: #include<iostream.h> class Contain { private: int X; protected: int z; public: class Embed { private: int y; public: Embed(){y=100;} int Embed_Fun(); }MyEmbed; int Contain_Fun(

    A.定义类Embed对象的语句是:Contain? Embed embed;

    B.类Contain的成员函数Contain_Fun()中可以用MyEmbe D.y的方式访问类Embed的私有成员y

    C.类Embed的成员函数Embed_Fun()中可以直接访问Contain的私有成员x

    D.类Embed的成员函数Embed_Fun()中可以直接访问Contain的保护成员Z


    正确答案:A

  • 第2题:

    Whatarethefoursteps,intheircorrectorder,tomitigateawormattack?()

    A.contain,inoculate,quarantine,andtreat

    B.inoculate,contain,quarantine,andtreat

    C.quarantine,contain,inoculate,andtreat

    D.preparation,identification,traceback,andpostmortem

    E.preparation,classification,reaction,andtreat

    F.identification,inoculation,postmortem,andreaction


    参考答案:A

  • 第3题:

    【单选题】对于建立在数据库上的DDL触发器,常用的激活DDL触发器的事件不包括()

    A.Create_Table,Alter_Table,Drop_Table

    B.Create_View,Alter_View,Drop_View

    C.Create_Procedure,Alter_Procedure,Drop_Procedure

    D.Rollback


    Rollback

  • 第4题:

    类 Contain 的定义如下: class Contain { private: int x; protected: int z; public: class Embed { private: int y; public: Embed ( ) { y=100; } int Embed_Fun(); }MyEmbed; int Contain_Fun(); }; 下列对上面定义的描述中,正确的是( )。

    A.定义类Embed对象的语句是:Contain::Embed Myobject;

    B.类Contain的成员函数Contain_Fun()中可以访问对象MyEmbed的私有成员y

    C.类Embed的成员函数Embed_Fun()中可以直接访问类Contain的所有成员

    D.类Embed的成员函数Embed_Fun()中只能直接访问类Contain的公有成员


    正确答案:A
    解析:对象MyEmbed是类Contain的成员对象,通过对象MyEmbed不能访问其私有数据成员y,所以选项B是错误的。类Embed是类Contain的嵌套类,类Embed的成员函数不能直接访问类Contain的所有成员,所以选项C和D都是错误的。

  • 第5题:

    Most operating systems have a standard set of ( ) to handle the processing of all input and output instructions.

    A.spreadsheet
    B.control instructions
    C. I/O operation
    D.datA.table

    答案:B
    解析:
    翻译:

    大多数操作系统都有一套标准的(71)处理所有的输入和输出指令。

    A. 电子表格 B. 控制指令

    C. I/O操作 D. 数据表

  • 第6题:

    如果要让某个用户能够在所有模式下建表应该授予此用户哪个权限?

    A.create table

    B.create any table

    C.create all table

    D.create * table


    create any table