您在这里:首页 > 技术沙龙&教程 > 资源共享
Oracle视频
Oracle
CUUG课程

练习题(五)

 1. You want to display inventory id numbers and their descriptions with these desired results:
1. The price of the item must be 8.25 or .25.
2. The display must be sorted alphabetically by the item description.
3. The items must have been ordered prior to June 10, 1997.
Evaluate this SQL script:
SELECT id_number, description
FROM inventory
WHERE price IN (8.25, 0.25)
ORDER BY description desc;
What does the proposed solution provide?

A. one of the desired results
B. two of the desired results
C. all of the desired results
D. no results because the statement will not execute
Answer:

2.You need to disable the PRIMARY KEY constraint on the ID column in the INVENTORY table
and update all the values in the INVENTORY table. After the update is complete, you need
to enable the constraint and verify that column values do not violate the constraint. If any of
the ID column values do not conform to the constraint, an error message should be returneD.
Evaluate this command:
ALTER TABLE inventory
ENABLE CONSTRAINT inventory_id_pk;
Which statement is true?

A. The statement will achieve the desired results.
B. The statement will execute, but will not enable the PRIMARY KEY constraint.
C. The statement will execute, but will not verify that values in the ID column do not violate the
constraint.
D. The statement will return a syntax error.
Answer:

3.Which SELECT statement displays the number of items whose PRICE value is greater than
5.00?

A. SELECT SUM
FROM inventory
WHERE price > 5.00;
B. SELECT COUNT
FROM inventory
ORDER BY price;
C. SELECT COUNT
FROM inventory
WHERE price > 5.00;
D. SELECT SUM
FROM inventory
GROUP BY price > 5.00;
Answer:

4. In which two statements would you typically use the CURRVAL pseudocolumn? (Choose
two.)

A. SELECT list of a view
B. SET clause of an UPDATE statement
C. subquery in an UPDATE statement
D. VALUES clause of an INSERT statement
e. SELECT statement with the HAVING clause
Answer:

5.Which statement will you use to eliminate the need for all users to qualify Marilyn's
INVENTORY table with its schema when querying?

A. CREATE SYNONYM inventory
FOR inventory;
B. CREATE PUBLIC SYNONYM inventory
FOR marilyn;
C. CREATE PUBLIC SYNONYM inventory
FOR marilyn.inventory;
D. CREATE PUBLIC inventory SYNONYM
FOR marilyn.inventory;
Answer:

6.Evaluate this PL/SQL block:
BEGIN
FOR i IN 1..6 LOOP
IF i = 2 OR i = 3 THEN
null;
ELSE
INSERT INTO example(one)
VALUES (i);
END IF;
ROLLBACK;
END LOOP;
COMMIT;
END;
How many values will be inserted into the EXAMPLE table?

A. 0
B. 1
C. 2
D. 3
e. 4
Answer:
相关文章 [上一篇] 练习题(四)
010-88589926(88587026)
CUUG热门培训课程
Oracle DBA就业培训
CUUG名师
网络课程
技术沙龙
最新动态

总机:(010)-88589926,88589826,88587026 QQ讨论群:243729577 182441349 邮箱:cuug_bj@cuug.com
通信地址:北京市海淀区紫竹院路98号北京化工大学科技园609室(CUUG)邮政编码:100089 
中国UNIX用户协会 Copyright 2010  ALL Rights Reserved 北京神脑资讯技术有限公司
京ICP备11008061号  京公网安备110108006275号