1. 程式人生 > >OCP-1Z0-051-題目解析-第22題

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

22. You need to create a table for a banking application. One of the columns in the table has the following requirements: 
1) You want a column in the table to store the duration of the credit period. 
2) The data in the column should be stored in a format such that it can be easily added and subtracted with     
   DATE data type without using conversion functions. 
3) The maximum period of the credit provision in the application is 30 days. 
4) The interest has to be calculated for the number of days an individual has taken a credit for. 
Which data type would you use for such a column in the table? 
(你需要建立一個銀行業務表,其中一個欄位有如下要求:
1)該欄位需要儲存信貸期限的持續時間。
2)不使用轉換函式,就可以簡單的和Date資料型別加減。
3)應用中信貸發放的最大週期是30天
4)已經擁有信用卡的個人,按天計算利息。)

A. DATE 
B. NUMBER 
C. TIMESTAMP 
D. INTERVAL DAY TO SECOND 

E. INTERVAL YEAR TO MONTH 

Answer: D 

A:Date型別儲存的是一個時間點,不是一段時間 (錯誤)
B:number型別不能和date型別簡單的加減 (錯誤)
C: 和A一樣儲存的是時間點(錯誤)
D: 正確
E: 錯誤,不能精確到天