Chinaunix首页 | 论坛 | 博客
  • 博客访问: 17005
  • 博文数量: 36
  • 博客积分: 0
  • 博客等级: 民兵
  • 技术积分: 210
  • 用 户 组: 普通用户
  • 注册时间: 2021-11-30 10:47
文章分类
文章存档

2022年(28)

2021年(8)

我的朋友

分类: Oracle

2022-02-15 16:33:36

24、Evaluate these commands which execute successfully:

CREATE SEQUENCE ord_seq

INCREMENT BY 1

START WITH 1

MAXVALUE 100000

CYCLE

CACHE 5000;

CREATE TABLE ord_items(

ord_no NUMBER(4) DEFAULT ord_seq.NEXTVALUE NOT NULL,

item_no NUMBER(3),

qty NUMBER(3),

expiry_date DATE,

CONSTRAINT it_pk PRIMARY KEY(ord_no,item_no),

CONSTRAINIT ord_fk FOREIGN KEY(ord_no) REFERENCES orders (ord_no));

Which two statements are true about the ORD_ITEMS table and the ORD_SEQ sequence? (Choose two.)

A. If sequence ORD_SEQ is dropped then the default value for column ORD_NO will be NULL for rows inserted into ORD_ITEMS

B. Any user inserting rows into table ORD_ITEMS must have been granted access to sequence ORD_SEQ

C. Column ORD_NO gets the next number from sequence ORD_SEQ whenever a row is inserted into ORD_ITEMS and no explicit value is given for ORD_NO

D. Sequence ORD_SEQ cycles back to 1 after every 5000 numbers and can cycle 20 times

E. Sequence ORD_SEQ is guaranteed not to generate duplicate numbers

阅读(207) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~