You are on page 1of 4

Section 18 Quiz

(Answer all questions in this section)
1. Table MYTAB contains only one column of datatype CHAR(1). A user executes the
following statements in the order shown. Mark for Review
(1) Points
INSERT INTO mytab VALUES ('A');
INSERT INTO mytab VALUES ('B');
COMMIT;
INSERT INTO mytab VALUES ('C');
ROLLBACK;

Which rows does the table now contain?
A, B, and C
A and B (*)
C
None of the above

Correct
2. Steven King's row in the EMPLOYEES table has EMPLOYEE_ID = 100 and SALARY =
24000. A user issues the following statements in the order shown: Mark for Review
(1) Points
UPDATE employees
SET salary = salary * 2
WHERE employee_id = 100;
COMMIT;

UPDATE employees
SET salary = 30000
WHERE employee_id = 100;

The user's database session now ends abnormally. What is now King's salary in the
table?
48000 (*)
30000
78000
24000

Correct
3. Which SQL statement is used to remove all the changes made by an uncommitted
transaction? Mark for Review
(1) Points
ROLLBACK TO SAVEPOINT;
REVOKE;
UNDO;
ROLLBACK; (*)

Correct

SAVEPOINT upd1_done. COMMIT Del_Done. either all changes must be rolled back. How would you undo the last Update only? ROLLBACK UPDATE. DELETE FROM employees. Examine the following statements: Mark for Review (1) Points INSERT INTO emps SELECT * FROM employees. True or False? Mark for Review (1) Points True (*) False Correct 5. 4. Examine the following statements: Mark for Review (1) Points UPDATE employees SET salary = 15000. You want to retain all the employees with a salary of 15000. If Oracle crashes. If a database crashes. There is nothing you can do. -. There is nothing you can do. UPDATE employees SET salary = 22000. Correct Section 18 Quiz (Answer all questions in this section) 6. What statement would you execute next? ROLLBACK. SAVEPOINT Ins_Done. your changes are automatically rolled back. UPDATE emps SET last_name = 'Smith'. True or False? Mark for Review (1) Points . all uncommitted changes are automatically rolled back. -.107 rows inserted. or none of them can be rolled back. ROLLBACK to SAVEPOINT Del_Done. (*) ROLLBACK TO SAVEPOINT upd2_done.107 rows deleted SAVEPOINT Del_Done. SAVEPOINT upd2_done. ROLLBACK TO SAVE upd1_done. ROLLBACK TO SAVEPOINT upd1_done. DELETE employees. (*) Correct 7.

you want to be able to rollback the later changes while keeping the earlier changes. Oracle does it all for you. Which of the following best describes the term "read consistency"? Mark for Review (1) Points It ensures that all changes to a table are automatically committed It prevents other users from seeing changes to a table until those changes have been committed (*) It prevents users from querying tables on which they have not been granted SELECT privilege . What result will JANE see? 2 22 20 (*) JANE will receive an error message because she is not allowed to query the table while BOB is updating it. User JANE now executes: Mark for Review (1) Points SELECT COUNT(*) FROM bob. BOB inserts two more rows into the table but does not COMMIT his changes.customers. True or False? Mark for Review (1) Points True False (*) Correct 10. You need not worry about controlling your transactions. If required. What must you Mark for Review include in your code to do this? (1) Points An object privilege A database link A savepoint (*) A sequence An update statement Correct Section 18 Quiz (Answer all questions in this section) 11. A transaction makes several successive changes to a table. True (*) False Correct 8. Correct 9. User BOB's CUSTOMERS table contains 20 rows.

CREATE INDEX emp_lname_idx ON employees(last_name). True or False? Mark for Review (1) Points True False (*) Correct 14. What happens if you issue a Rollback statement? The update of last_name is undone. Examine the following statements: Mark for Review (1) Points INSERT INTO emps SELECT * FROM employees. UserB can see that data. as soon as UserA has entered data into that table. your data changes are automatically rolled back. The INSERT is undone but the UPDATE is committed. It prevents other users from querying a table while updates are being executed on it Correct 12. When you logout of Oracle. UPDATE emps SET last_name = 'Smith'. True or False? Mark for Review (1) Points True False (*) Correct .107 rows inserted. Nothing happens. If UserB has privileges to see the data in a table. (*) Both the UPDATE and the INSERT will be rolled back. but the insert was committed by the CREATE INDEX statement. SAVEPOINT Ins_Done. COMMIT saves all outstanding data changes? True or False? Mark for Review (1) Points True (*) False Correct 13. Correct 15. -.