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?
A.
DATE
B.
NUMBER
C.
TIMESTAMP
D.
INTERVAL DAY TO SECOND
E.
INTERVAL YEAR TO MONTH
can you please any one explain why d is correct?
D because:
1. interval day to second store day, hour, miniute, second (INTERVAL ‘1’ Day)
2. it can be easly added to date ex. SYSDATE + INTERVAL ‘1’ Day, you don`t need conversion
3. maximum period of 30days is the reason why E is incorrect, to be honest it`s correct but why to store year if you have more precisely type like Interval Day to Second