一、原题
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
二、题目翻译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
查看TRANSACTIONS表结构
关于上面表结构数据创建和存储哪句话是正确的?(选择所有正确的选项)
A. CUST_STATUS列将报错
B. TRANS_VALIDITY列将报错
C. CUST_STATUS列将精确的存储一个字符
D. CUST_CREDIT_LIMIT列不能存储小数值
E. TRANS_VALIDITY列将会有一个字符的最大大小
F. TRANS_DATE列能存储日,月,世纪,年,小时,分,秒,小数秒
三、题目解析关于上面表结构数据创建和存储哪句话是正确的?(选择所有正确的选项)
A. CUST_STATUS列将报错
B. TRANS_VALIDITY列将报错
C. CUST_STATUS列将精确的存储一个字符
D. CUST_CREDIT_LIMIT列不能存储小数值
E. TRANS_VALIDITY列将会有一个字符的最大大小
F. TRANS_DATE列能存储日,月,世纪,年,小时,分,秒,小数秒
A选项不正确,因为CUST_STATUS列定义的CHAR类型是可以省略size的,默认为1byte
B选项正确,因为TRANS_VALIDITY的varchar2类型,没有长度,所以会报错。
C选项正确,因为CHAR类型不写长度,默认是1.
D选项不正确,因为NUMBER可以存储小数值,会四舍五入。
E选项不正确,因为VARCHAR2数据类型必须要指定size,比如VARCHAR(10),否则会报错
F选项不正确,因为DATE类型不能存储小数秒
B选项正确,因为TRANS_VALIDITY的varchar2类型,没有长度,所以会报错。
C选项正确,因为CHAR类型不写长度,默认是1.
D选项不正确,因为NUMBER可以存储小数值,会四舍五入。
E选项不正确,因为VARCHAR2数据类型必须要指定size,比如VARCHAR(10),否则会报错
F选项不正确,因为DATE类型不能存储小数秒