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: 錯誤,不能精確到天