QuestionQ66

VerifiedRelational Database concepts

You have been asked to create a table for a banking application.

One column must satisfy these three requirements:

  1. Be stored in a format that supports date arithmetic without conversion functions.
  2. Store a loan period of up to 10 years.
  3. Be used to calculate interest based on the number of days that the loan remains unpaid.

Which data type should be used?

Explanation

INTERVAL DAY TO SECOND stores an elapsed period in days, hours, minutes, and seconds and supports interval arithmetic. Defining sufficient day precision accommodates a 10-year period, while retaining the number of days needed for interest calculations. INTERVAL YEAR TO MONTH does not store a day component, and timestamp types represent individual points in time rather than a loan duration.

Learn more

Community Discussion

No comments yet. Be the first to start the discussion!