Which two statements are true ab
一、原题
Which two statements are true about sequences created in a single instance database? (Choose
two.)
A. CURRVAL is used to refer to the last sequence number that has been generated
B. DELETE <sequencename> would remove a sequence from the database
C. The numbers generated by a sequence can be used only for one table
D. When the MAXVALUE limit for a sequence isreached, you can increase the MAXVALUE limit
by using the ALTER SEQUENCE statement
E. When a database instance shuts down abnormally, the sequence numbers that have been
cached but not used would be available once again when the database instance is restarted
答案: A,D
二、题目翻译
下面关于在一个单实例中创建序列(sequence)的说法,哪两个是正确的?(选择两项)
A.CURRVAL是序列生成的最后一个值。
B.DELETE <sequencename> 会从数据库中删除一个序列。
C.序列生成的值只能用在一个表中。
D.当序列生成的值达到MAXVALUE设置的极限值时,可以使用ALTER SEQUENCE命令来修改MAXVALUE的值。
E.当一个数据库实例非正常关闭时,已经生成但还没有使用的值,在实例重新启动生会再用一次。
三、题目解析
A选项正确,CURRVAL是当前值,也就是序列生成的最后一个值。
B选项不正确,删除序列,应该是DROP SEQUENCE <sequencename> 。
C选项不正确,序列生成的值可以用于多张表中。
D选项正确,ALTER SEQUENCE命令可以修改包括MAXVALUE在内的一些参数值。
E选项不正确,生成值还没有使用的值,是指cache在内存中的值,这些值在实例非正常关闭后,就丢失了,不会再被使用了。