🎴 Flashcard Mode

Oracle Database: SQL, RMAN, and IDMS Fundamentals

Card1 / 20
Mastered0
Review0
QuestionClick to flip

Which four statements correctly describe functions that are available in SQL? (Choose four.)

AnswerClick to flip back
A
INSTR returns the numeric position of a named character.
B
DECODE translates an expression after comparing it to each search value.
C
TRIM trims the heading or trailing characters (or both) from a character string.
D
NULLIF compares two expressions and returns null if they are equal, or the first expression if they are not equal.
💡 Explanation:

INTR finds the numeric position of a substring within a string, making option A correct. DECODE is a conditional function that compares an expression to search values and returns corresponding results, so D is correct. TRIM removes leading or trailing characters (or both) from strings, so E is correct. NULLIF compares two expressions and returns null if equal or the first expression if not equal, so F is correct. NVL2 does not return the first non-null expression (that's COALESCE) - NVL2 returns different values based on whether the first expression is null. TRUNC removes decimal places without rounding, while ROUND would round.

Change Mode