QuestionQ180

VerifiedManipulating Data

Review the description of the PRODUCT_STATUS table:

Question Image

For each row, the STATUS column contains either IN STOCK or OUT OF STOCK. Which two queries will execute successfully?

Choose two
Explanation

Oracle's alternative quoting operator (q'delimiter...delimiter') only supplies a string literal; like any literal it must be attached to a column value with the || concatenation operator rather than placed immediately adjacent to the column name. Column aliases containing spaces must be enclosed in double quotation marks and must appear once, at the very end of the full select-list expression. The two statements that correctly use prod_id || q'('s not available)', one without an alias and one with a correctly positioned double-quoted alias at the end, satisfy both rules and execute successfully, while the others break one of these syntax requirements.

Learn more

Community Discussion

No comments yet. Be the first to start the discussion!