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;
考查字符串的连接。 字符串中包含但引号应该如何处理
prod_name || 's category is || prod_category
有两种实现方法。
1。 用两个单引号代替一个单引号
SELECT prod_name || '''scategory is ' || prod_category CATEGORIES from products;
2.使用q 操作符号
select q'[It's Oracle's world ]' from dual
A. SELECT prod_name || q'''s category is '' || prod_category CATEGORIES
FROM products;
选项 B category 前面缺少单引号
B. SELECT prod_name || q'['s ]' || ‘category is ' || prod_category CATEGORIES
FROM products;
正确答案是CD