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.
答案:BC
解析:varchar2最小为1,最大为4000,PLSQL中为32767,必须指定长度,char不指定长度默认为1
A:错误,CUST_STATUS没有指定长度默认为1
B:正确,TRANS_VALIDITY varchar2类型必须定义长度
C:正确,CUST_STATUS默认为1
D:错误,CUST_CREDIT_LIMIT number类型,可以存储十进制
E:错误,TRANS_VALIDITY 必须指定长度
F:错误,date不能存储小数秒
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.
答案:BC
解析:varchar2最小为1,最大为4000,PLSQL中为32767,必须指定长度,char不指定长度默认为1
A:错误,CUST_STATUS没有指定长度默认为1
B:正确,TRANS_VALIDITY varchar2类型必须定义长度
C:正确,CUST_STATUS默认为1
D:错误,CUST_CREDIT_LIMIT number类型,可以存储十进制
E:错误,TRANS_VALIDITY 必须指定长度
F:错误,date不能存储小数秒