Oracle Database SQL — Question 74
Which two queries return the string Hello! We're ready? (Choose two.)
Answer options
- A. SELECT "Hello! We're ready" FROM DUAL;
- B. SELECT 'Hello! We're ready' FROM DUAL;
- C. SELECT q'!Hello! We're ready!' FROM DUAL;
- D. SELECT q'[Hello! We're ready]' FROM DUAL;
- E. SELECT 'Hello! We\'re ready’ ESCAPE '\' FROM DUAL;
Correct answer: C, D
Explanation
Options C and D correctly use the quoted string syntax in SQL to return the desired output. Option A and B are incorrect because they use single or double quotes without proper escaping for the apostrophe, while option E incorrectly escapes the apostrophe and uses a non-standard quote character.