Oracle Database SQL — Question 143
You have been tasked to create a table for a banking application.
One of the columns must meet three requirements:
1) Be stored in a format supporting date arithmetic without using conversion functions
2) Store a loan period of up to 10 years
3) Be used for calculating interest for the number of days the loan remains unpaid
Which data type should you use?
Answer options
- A. INTERVAL YEAR TO MONTH
- B. TIMESTAMP WITH TIMEZONE
- C. INTERVAL DAY TO SECOND
- D. TIMESTAMP WITH LOCAL TIMEZONE
- E. TIMESTAMP
Correct answer: C
Explanation
The correct answer is C, INTERVAL DAY TO SECOND, as it allows for storing durations in days and seconds, suitable for calculating interest on unpaid loans. A is incorrect because INTERVAL YEAR TO MONTH does not support day-level precision necessary for interest calculations. B, D, and E are timestamps, which do not fulfill the requirement for a column that specifically needs to represent a loan duration.