Which two queries would give the required output?

View the Exhibit and examine the structure of the PRODUCTS table.
You need to generate a report in the following format:
CATEGORIES
5MP Digital Photo Camera’s category is Photo
Y Box’s category is Electronics
Envoy Ambassador’s category is Hardware
Which two queries would give the required output? (Choose two.)

View the Exhibit and examine the structure of the PRODUCTS table.

You need to generate a report in the following format:

CATEGORIES
5MP Digital Photo Camera’s category is Photo
Y Box’s category is Electronics
Envoy Ambassador’s category is Hardware

Which two queries would give the required output? (Choose two.)

A.
SELECT prod_name q”’s category is ‘ prod_category CATEGORIES FROM products;

B.
SELECT prod_name q'[‘s ]’category is ‘ prod_category CATEGORIES FROM products;

C.
SELECT prod_name q’\’s\’ ‘ category is ‘ prod_category CATEGORIES FROM products;

D.
SELECT prod_name q'<‘s >’ ‘category is ‘ prod_category CATEGORIES FROM products;



Leave a Reply 14

Your email address will not be published. Required fields are marked *


malou_paredes

malou_paredes

C. SELECT prod_name || q’\’s\’ || ‘ category is ‘ || prod_category CATEGORIES FROM products;
D. SELECT prod_name || q” || ‘category is ‘ || prod_category CATEGORIES FROM products;

admin

admin

Updated answers.

sonam

sonam

Hi, please tell me why B is incorrect?

Justyna

Justyna

B is incorrect because concatenation is missing between q'[‘s]’ and text ‘category is’. See my another update for the correct select statement.
To have correct statement:
SELECT prod_name||q'[‘s ]’||’ category is’||’ prod_category CATEGORIES FROM products;

or

SELECT prod_name||q'[‘s category is]’||’ prod_category CATEGORIES FROM products;

lukeluke

lukeluke

What’s different between symbol ‘ and symbol ’?

lukeluke

lukeluke

And I tried this pattern on this statement, but it failed on oracle 11g.

SELECT ENAME||q'[‘s ]’||’ category is’||’ SAL CATEGORIES FROM EMP;

Justyna

Justyna

I did not notice eariler but there is missing single quotation mark ‘ after prod_category in each statement.

SELECT prod_name||q'[‘s ]’||’ category is’||’prod_category’ CATEGORIES FROM products.

Each quotation mark is the same. It is ‘. Something happend when I copied statements.

Justyna

Justyna

A.SELECT prod_name||q”’s category is||‘ prod_category CATEGORIES FROM products;
B. SELECT prod_name||q’[‘s ]‘category is||‘ prod_category CATEGORIES FROM products;
C. the same like above:
SELECT prod_name||q’\’s\’||‘ category is ‘||prod_category CATEGORIES FROM products;
D.SELECT prod_name||q’’||‘category is||‘ prod_category CATEGORIES FROM products;

JaviCas

JaviCas

Why is A incorrect?

Dipak Upwanshi

Dipak Upwanshi

what is the role of ‘q’ in the query?

spellublind

spellublind

A is incorrect because the expression should be without “q”

select prod_name||”’s category is ‘||prod_category CATEGORIES from products;

spellublind

spellublind

just to add on option a could also be
select prod_name||q”’s category is ”||prod_category CATEGORIES from products;

angelos

angelos

Why are the pipes || omitted from the queries???