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

24. 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 VARCHAR2 

TRANS_DATE             NOT NULL DATE

TRANS_VALIDITY                  INTERVAL DAY TO SECOND

CUST_CREDIT_VALUE               NUMBER(10)

Which two statements are true regarding the storage of data in the above table structure? (Choose two.)

A. The TRANS_DATE column would allow storage of dates only in the dd-mon-yyyy format. 

B. The CUST_CREDIT_VALUE column would allow storage of positive and negative integers. 

C. The TRANS_VALIDITY column would allow storage of a time interval in days, hours, minutes, and

seconds. 

D. The CUST_STATUS column would allow storage of data up to the maximum VARCHAR2 size of 4,000

characters.

Answer: BC

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

INTERVAL DAY TO SECOND:可以将时间存储为以天数、时数、分钟数和秒数表示的间隔。用于表示两个日期时间值之间的精确差。
所以C正确。

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

 DATE:公元前4712年1月1日到公元9999年12月31日之间的日期和时间值,精确到最接近的秒。可以使用to_date转换成不同的时间格式,所以A错误。


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