OCP-1Z0-051-題目解析-第23題

來源:互聯網
上載者:User

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 


1)VARCHAR2 長度可變字元資料類型( MaxSize=4000,MinSize=1,必須指定MaxSize)
2)CHAR 固定長度的字元資料類型(MaxSize=2000,MinSize=1,不指定預設為1)
3)NUMBER類型的文法:NUMBER(p,s):
p:精度位,precision,是總有效資料位元數,取值範圍是38,預設是38,可以用字元*表示38。
s:小數位,scale,是小數點右邊的位元,取值範圍是-84~127,預設值取決於p,如果沒有指定p,那麼s是最大範圍,如果指定了p,那麼s=0。
4)DATE:只能精確到秒。


A:CUST_STATUS欄位給出錯誤。(錯誤,參見上面的1)
B:TRANS_VALIDITY欄位給出錯誤。(正確,參見2)
C: CUST_STATUS 能正確的儲存一個字元。(正確,參見2)
D: CUST_CREDIT_LIMIT欄位不能儲存小數。(錯誤,參見3)
E: TRANS_VALIDITY 欄位最大值是一個字元。(錯誤,參見1)
F: TRANS_DATE 欄位可以儲存 天、月、世紀、年、小時、分鐘、秒和小數部分的秒。(錯誤,參見4)

相關文章

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.