设为首页 加入收藏

TOP

ocp 1Z0-051 1-22题解析(五)
2014-11-23 22:31:36 来源: 作者: 【 】 浏览:15
Tags:ocp 1Z0-051 1-22 解析
name should have the heading Name and the incremented creditlimit

should be labeled NewCredit Limit. The column headings should have only the first letter of eachword in

uppercase .

Which statement wouldaccomplish this requirement

A. SELECT cust_last_nameName, cust_credit_limit + 1000

"New CreditLimit"

FROM customers;

B. SELECT cust_last_nameAS Name, cust_credit_limit + 1000

AS New Credit Limit

FROM customers;

C. SELECT cust_last_nameAS "Name", cust_credit_limit + 1000

AS "New CreditLimit"

FROM customers;

D. SELECTINITCAP(cust_last_name) "Name", cust_credit_limit + 1000

INITCAP("NEW CREDITLIMIT")

FROM customers;

Answer: C

解析:

scott@ORCL>selectename Name,sal+1000 "New Credit Litmit" from emp;

NAME New Credit Litmit

scott@ORCL>selectename as "Name",sal+1000 as "New Credit Limit" from emp;

Name New Credit Limit

加上as 才能以规定样式输出,当然双引号也可以:

scott@ORCL>selectename "Name",sal+1000 "New Credit Litmit" from emp;

Name New Credit Litmit

13. View the Exhibit andexamine the structure of the PRODUCTS table.

You need to generate areport in the following format:

CATEGORIES

5MP Digital Photo Camera'scategory is Photo

Y Box's category isElectronics

Envoy Ambassador'scategory is Hardware

Which two queries wouldgive 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_categoryCATEGORIES

FROM products;

C. SELECT prod_name || q''s' || 'category is ' || prod_categoryCATEGORIES

FROM products;

D. SELECT prod_name || q'<'s>' || 'category is ' || prod_category CATEGORIES

FROM products;

Answer: CD

解析:

scott@ORCL>selectename || q''s' || 'category is ' || sal from emp;

ENAME||Q''S'||'CATEGORYIS'||SAL

----------------------------------------------------------------

SMITH'scategory is 968

ALLEN'scategory is 1600

scott@ORCL>selectename || q'<'s>' ||'category is ' || sal from emp;

ENAME||Q'<'S>'||'CATEGORYIS'||SAL

----------------------------------------------------------------

SMITH'scategory is 968

14. Using the CUSTOMERStable, you need to generate a report that shows 50% of each credit

amount in each incomelevel. The report should NOT show any repeated credit amounts in each income

level.

Which query would givethe required result

A. SELECTcust_income_level, DISTINCT cust_credit_limit * 0.50

AS "50% CreditLimit"

FROM customers;

B. SELECT DISTINCTcust_income_level, DISTINCT cust_credit_limit * 0.50

AS "50% CreditLimit"

FROM customers;

C. SELECT DISTINCTcust_income_level || ' ' ||cust_credit_limit * 0.50

AS "50%Credit Limit"

FROMcustomers;

D. SELECTcust_income_level ' ' cust_credit_limit * 0.50 AS "50% Credit Limit"

FROMcustomers;

Answer: C

解析:主要考察dictinct的应用,去除重复列

15. View the Exhibit andexamine the data in the CUSTOMERS table.

eva luate the followingquery:

SQL> SELECT cust_nameAS "NAME", cust_credit_limit/2 AS MIDPOINT,MIDPOINT+100 AS "MAX

LOWER LIMIT"

FROM customers;

The above query producesan error on execution.

What is the reason forthe error

\

A. An alias cannot beused in an expression.

B. The a lias NAMEshould not be enclosed with in double quotation marks .

C. The MIDPOINT+100expression gives an error because CUST_CREDIT_LIMIT contains NULL

values.

D. The a lias MIDPOINTshould be enclosed with in double quotation marks for the

CUST_CREDIT_LIMIT/2expression .

Answer: A

解析:明

首页 上一页 2 3 4 5 6 7 8 下一页 尾页 5/8/8
】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
分享到: 
上一篇pg_cancel_backend() 与pg_termin.. 下一篇MongoDB 复制集 (三) 内部数据同步

评论

帐  号: 密码: (新用户注册)
验 证 码:
表  情:
内  容: