OCP-1Z0-051-V9.02-23题

23. Examine the structure proposed for the TRANSACTIONS table:

name                    Null      Type

TRANS_ID               NOT NULL NUMBER(6) 

CUST_NAME              NOT NULL VARCHAR2(20) 

CUST_STATUS            NOT NULL CHAR 

TRANS_DATE             NOT NULL DATE 

TRANS_VALIDITY                  VARCHAR2 

CUST_CREDIT_LIMIT               NUMBER 

Which statements are true regarding the creation and storage of data in the above table structure?

(Choose all that apply.)

A. The CUST_STATUS column would give an error.

B. The TRANS_VALIDITY column would give an error.

C. The CUST_STATUS column would store exactly one character.

D. The CUST_CREDIT_LIMIT column would not be able to store decimal values.

E. The TRANS_VALIDITY column would have a maximum size of one character.

F. The TRANS_DATE column would be able to store day, month, century, year, hour, minutes, seconds,

and fractions of seconds.

Answer: BC
答案解析:
VARCHAR2长度可变的字符数据(必须指定最大size,最小size为1;最大size为4000)
TRANS_VALIDITY  的VARCHAR2没有指定size,所以错误。B正确。E错误。

CHAR 固定长度的字符数据,长度为size字节(默认和最小size为1;最大size为2000),可以不用指定size
所以CUST_STATUS的CHAR,没有指定size,但默认size为1,不会报错,所以A是错误的。C是正确的。

NUMBER [(p,s)]精度为p和小数位为s的数字(精度是十进制数字的总位数,而小数位数是小数点右侧的位数,精度范围在1~38之间,而该小数位数范围在-84~127之间),
所以CUST_CREDIT_LIMIT 的NUMBER数据类型是可以存储小数位的,D错误。

 DATE:公元前4712年1月1日到公元9999年12月31日之间的日期和时间值,精确到最接近的秒。但是没有小数秒,所以F错误。


原文地址:https://www.cnblogs.com/hzcya1995/p/13316807.html