技术活动
CUUG学员就业信息
学员感言、就业资讯
报名热线
软件&工具
当前您的位置:首页 > 技术活动 > 技术中心 > 软件&工具
练习题(五)-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: