Q: 2
Which two are true about the NVL, NVL2, and COALESCE functions?
Options
Discussion
You want D and E here. COALESCE goes until it finds a non-null, so D, and NVL does force types to match, so E. The others are distractors. Pretty sure this is right but always possible I'm missing a weird edge case.
Not D only, E matters too since NVL requires matching data types. C is a trap, COALESCE returns at the first non-null, not null.
D , COALESCE returns the first non-null, not null, so D is correct. E is right too since NVL needs compatible datatypes. The others trip people up but don't match Oracle SQL behavior. Open to corrections if anyone sees a gotcha.
Maybe C and E. COALESCE is supposed to stop when it finds the first null, and NVL does require datatype matching. I think that's right, but I'm a bit unsure about C since the logic of COALESCE can be confusing. Anyone disagree?
C tbh, since COALESCE with a null check seems right but maybe I'm missing the NVL part.
D and E. NVL needs same data type, COALESCE returns first non-null. Saw similar on practice exam, pretty sure that's it.
Be respectful. No spam.