36. Evaluate the following statements:
CREATE TABLE digits
(id NUMBER(2),
description VARCHAR2(15));
INSERT INTO digits VALUES (1,'ONE');
UPDATE digits SET description ='TWO' WHERE id=1;
INSERT INTO digits VALUES (2,'TWO');
COMMIT;
DELETE FROM digits;
SELECT description FROM digits
VERSIONS BETWEEN TIMESTAMP MINVALUE AND MAXVALUE;
What would be the outcome of the above query?
A. It would not display any values.
B. It would display the value TWO once.
C. It would display the value TWO twice.
D. It would display the values ONE, TWO, and TWO.
CREATE TABLE digits
(id NUMBER(2),
description VARCHAR2(15));
INSERT INTO digits VALUES (1,'ONE');
UPDATE digits SET description ='TWO' WHERE id=1;
INSERT INTO digits VALUES (2,'TWO');
COMMIT;
DELETE FROM digits;
SELECT description FROM digits
VERSIONS BETWEEN TIMESTAMP MINVALUE AND MAXVALUE;
What would be the outcome of the above query?
A. It would not display any values.
B. It would display the value TWO once.
C. It would display the value TWO twice.
D. It would display the values ONE, TWO, and TWO.
Answer: C
实验
SQL> create table digits (id number(2),description varchar2(15));
Table created
SQL> insert into digits values (1,'ONE');
1 row inserted
SQL> update digits set description='TOW' where id=1;
1 row updated
SQL> insert into digits values(2,'TOW');
1 row inserted
SQL> commit;
Commit complete
SQL> select * from digits;
ID DESCRIPTION
--- ---------------
1 TOW
2 TOW
SQL> delete from digits;
2 rows deleted
SQL> select description from digits versions between timestamp minvalue and maxvalue;
DESCRIPTION
---------------
TOW
TOW