ITPub博客

首页 > 数据库 > Oracle > OCP 1Z0-051-31

OCP 1Z0-051-31

原创 Oracle 作者:LuiseDalian 时间:2014-05-12 07:05:33 0 删除 编辑
(31)Evaluate the following SQL commands:

The command to create a table fails. Identify the reason for the SQL statement failure? (Choose all that apply.)

A. You cannot use SYSDATE in the condition of a CHECK constraint.

B. You cannot use the BETWEEN clause in the condition of a CHECK constraint.

C. You cannot use the NEXTVAL sequence value as a DEFAULT value for a column.

D. You cannot use ORD_NO and ITEM_NO columns as a composite primary key because ORD_NO is also the FOREIGN KEY.


答案:(A、C)

解析:

--C

create sequence seq_t

start with 1

increment by 1

maxvalue 10

nocycle

nocache;

create table t

(

  col1 number(2),

  col2 number(4) default seq_t.nextval

)

  col2 number(4) default seq_t.nextval

                         *

ERROR at line 4:

ORA-00984: column not allowed here


来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/17013648/viewspace-1158776/ ,如需转载,请注明出处,否则将追究法律责任。

上一篇: OCP 1Z0-051-40
下一篇: OCP 1Z0-051-33
请登录后发表评论 登录
全部评论

注册时间:2012-02-06

  • 博文量
    1986
  • 访问量
    6040916