1Z0-060 · Question #153
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 correct answer is D. INTERVAL DAY TO SECOND. INTERVAL DAY TO SECOND is the correct Oracle data type for storing a credit duration because it natively represents a time span in days and can be directly added to or subtracted from DATE values without any conversion functions.
Question
Options
- ADATE
- BNUMBER
- CTIMESTAMP
- DINTERVAL DAY TO SECOND
- EINTERVAL YEAR TO MONTH
How the community answered
(46 responses)- A4% (2)
- B2% (1)
- C9% (4)
- D83% (38)
- E2% (1)
Why each option
INTERVAL DAY TO SECOND is the correct Oracle data type for storing a credit duration because it natively represents a time span in days and can be directly added to or subtracted from DATE values without any conversion functions.
DATE stores a specific point in time (year, month, day, hour, minute, second), not a duration or elapsed period, so it cannot represent 'number of days of credit.'
NUMBER stores a plain numeric value and requires explicit conversion functions (such as adding a numeric value to a DATE) rather than being directly interoperable with date arithmetic.
TIMESTAMP stores a precise moment in time with fractional seconds and does not represent a duration between two points in time.
The INTERVAL DAY TO SECOND data type stores a duration expressed in days, hours, minutes, and seconds, which means it directly satisfies the requirement for native DATE arithmetic without conversion functions. Oracle allows INTERVAL DAY TO SECOND values to be added to or subtracted from DATE columns, returning a DATE result natively, which supports both credit period calculations and per-day interest computations. It can represent any period up to the configured maximum number of days, easily accommodating the 30-day maximum requirement.
INTERVAL YEAR TO MONTH stores durations only in whole years and months and cannot represent day-level granularity, making daily interest calculations impossible.
Concept tested: Oracle INTERVAL DAY TO SECOND data type for duration storage
Source: https://docs.oracle.com/en/database/oracle/oracle-database/19/sqlrf/Data-Types.html#GUID-DC8AC4D6-C4F5-4436-8B24-E1D7839E3AF2
Topics
Community Discussion
No community discussion yet for this question.