Oracle SQL Functions Flashcards
6 cards from real Oracle SQL practice questions. Tap to flip, then mark Knew It or Still Learning — missed cards come back until you master them.
Read the first 6 Oracle SQL Functions flashcards as text
Which Oracle SQL function pads the left side of a string with a specified character to a given length?
Answer: LPAD
LPAD(string, length, pad_char) adds the pad character to the left of the string until it reaches the specified total length.
What does MONTHS_BETWEEN(date1, date2) return in Oracle SQL?
Answer: The number of complete months between two dates
MONTHS_BETWEEN returns the number of months (including fractional months) between two dates.
Which Oracle SQL function returns the first non-NULL value from a list of arguments?
Answer: COALESCE
COALESCE(expr1, expr2, ...) returns the first non-NULL expression in the list and accepts any number of arguments.
What does the NULLIF(expr1, expr2) function return in Oracle SQL?
Answer: NULL if expr1 equals expr2, otherwise expr1
NULLIF returns NULL when both arguments are equal; otherwise it returns the first argument.
Which Oracle SQL function adds a specified number of months to a date?
Answer: ADD_MONTHS
ADD_MONTHS(date, n) adds n months to the specified date, adjusting for end-of-month scenarios automatically.
What does the MOD function return in Oracle SQL when called as MOD(17, 5)?
Answer: 2
MOD(17, 5) returns the remainder of 17 divided by 5, which is 2 (since 5 × 3 = 15, and 17 - 15 = 2).