OCP-1Z0-051-题目解析-第31题
31. Evaluate the following SQL commands:
SQL>CREATE SEQUENCE ord_seq
INCREMENT BY 10
START WITH 120
MAXVALUE 9999
NOCYCLE;
SQL>CREATE TABLE ord_items
(ord_no NUMBER(4)DEFAULT ord_seq.NEXTVAL NOT NULL,
item_no NUMBER(3),
qty NUMBER(3) CHECK (qty BETWEEN 100 AND 200),
expiry_date date CHECK (expiry_date > SYSDATE),
CONSTRAINT it_pk PRIMARY KEY (ord_no,item_no),
CONSTRAINT ord_fk FOREIGN KEY(ord_no) REFERENCES orders(ord_no));
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.
Answer: AC
关于NextVal的使用限制
- 在 CREATE TABLE 或 ALTER TABLE 语句中。在下列上下文中不能指定 NEXTVAL 或 CURRVAL:
- 在 DEFAULT 子句中
- 在检查约束中。
- 在 SELECT 语句中,下列上下文中不能指定 NEXTVAL 或 CURRVAL:
- 使用 DISTINCT keyword时在投影列表中。
- 在 WHERE、GROUP BY 或 ORDER BY 子句中
- 在子查询中
- 在 UNION 运算符结合 SELECT 语句时。
- 在下列这些上下文中也不能指定 NEXTVAL 或 CURRVAL:
- 在分段存储表达式中
- 在对还有一个数据库中的远程序列对象的引用中。
A:sysdate不能用于check约束中(正确)
B:Between子句不能用于check约束中(错误)
C:NextVal不能用在Default中(正确)
D:ORD_NO and ITEM_NO不能被用作复合主键。由于ORD_NO同一时候也是外检(错误。一个字段能够同一时候被定义为主键和外键)
这题仅仅有C选项和上题不一样,能够參考第30题,
Nextval和CurrVal的使用能够參考:http://blog.csdn.net/wjx515628/article/details/35781109#t0
OCP-1Z0-051-题目解析-第31题的更多相关文章
- 1Z0-053 争议题目解析
1Z0-053 争议题目解析 Summary 题目NO. 题目解析链接地址 题库答案 参考答案 考查知识点 24 http://www.cnblogs.com/jyzhao/p/5319220.ht ...
- 1Z0-053 争议题目解析25
1Z0-053 争议题目解析25 考试科目:1Z0-053 题库版本:V13.02 题库中原题为: 25.You enabled Flashback Data Archive on the INVEN ...
- 1Z0-053 争议题目解析24
1Z0-053 争议题目解析24 考试科目:1Z0-053 题库版本:V13.02 题库中原题为: 24.Which of the following information will be gath ...
- 1Z0-053 争议题目解析46
1Z0-053 争议题目解析46 考试科目:1Z0-053 题库版本:V13.02 题库中原题为: 46.What happens when you run the SQL Tuning Adviso ...
- 1Z0-053 争议题目解析86
1Z0-053 争议题目解析86 考试科目:1Z0-053 题库版本:V13.02 题库中原题为: 86.Your production database is running in archivel ...
- 1Z0-053 争议题目解析134
1Z0-053 争议题目解析134 考试科目:1Z0-053 题库版本:V13.02 题库中原题为: 134.You are managing an Oracle Database 11g datab ...
- 1Z0-053 争议题目解析154
1Z0-053 争议题目解析154 考试科目:1Z0-053 题库版本:V13.02 题库中原题为: 154.A database is running in ARCHIVELOG mode and ...
- 1Z0-053 争议题目解析175
1Z0-053 争议题目解析175 考试科目:1Z0-053 题库版本:V13.02 题库中原题为: 175.You are peer reviewing a fellow DBAs backup p ...
- 1Z0-053 争议题目解析212
1Z0-053 争议题目解析212 考试科目:1Z0-053 题库版本:V13.02 题库中原题为: 212.Note the following parameters settings in you ...
随机推荐
- Currency System in Geraldion (Codeforces 560A)
A Currency System in Geraldion Time Limit:2000MS Memory Limit:262144KB 64bit IO Format:%I64 ...
- STM32使用串口1配合DMA接收不定长数据,减轻CPU载荷
STM32使用串口1配合DMA接收不定长数据,减轻CPU载荷 http://www.openedv.com/thread-63849-1-1.html 实现思路:采 用STM32F103的串口1,并配 ...
- [Swust OJ 763]--校门外的树 Plus(暴力枚举)
题目链接:http://acm.swust.edu.cn/problem/0763/ Time limit(ms): 1000 Memory limit(kb): 65535 西南某科技大学的校门外有 ...
- 二维码类库--phpqrcode使用简介
#载入类文件 include 'phpqrcode.php'; $value = '二维码内容'; $errorCorrectionLevel = 'L';//容错级别 L.M.Q.H $matrix ...
- php 学习笔记 数组3
15.使用数组 1).并集(union) array_merge(array1,array2,array3..) 函数把两个或多个数组合并为一个数组,后面覆盖前面 2). 交集(intersecti ...
- 纪念一下第一次写的django代码
@csrf_exemptdef new_project_detail(request): if 'project_name' not in request.POST or 'project_po ...
- 用nohup执行python程序时,print无法输出
python -u参数:关闭输出缓冲 nohup python -u test.py > nohup.out 2>&1 &
- java Hastable使用
jdk:http://docs.oracle.com/javase/1.4.2/docs/api/java/util/Hashtable.html Hashtable numbers = new Ha ...
- 自己用js写的两个日历控件
前一阵写了两个日历控件,做了简单的封装,发出来共朋友们参考. 第一个日历控件,条状的日历. (使用方法:调用initBarTime(id,evn),第一个参数是要渲染div的id,第二个参数是点击日期 ...
- Nginx的500,502,504错误解决方法
Nginx的500,502,504错误解决方法 一.解决500错误: 1.500错误指的是服务器内部错误,也就是服务器遇到意外情况,而无法履行请求. 2.500错误一般有几种情况: (1)web脚本错 ...