Data Mgmt Lab_Part_56 - 166 Chapter 16 SELECT * FROM...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
166 Chapter 16 SELECT * FROM Catalog C WHERE C.cost < 100 EXCEPT ( SELECT * FROM Catalog C WHERE C.cost < 100 ) INSERT INTO catalog (sid, pid, cost) VALUES (99, 38, 75.25) When we use SERIALIZABLE, we would expect that the frst SQL statement return nothing. But iF we instead use REPEATABLE READ, then it is possible that the phantom problem could occur From inserting a new tuple into the table, resulting in the frst SQL statement incorrectly returning a tuple (in this case the one inserted by the second SQL statement). 2. Suppose the same database instance as above and SQL statements shown below: UPDATE Catalog SET cost = cost * 0.95 WHERE sid = 31 UPDATE Catalog SET cost = cost * 0.95 WHERE sid = 31 When we use READ COMMITTED on the SQL statements above, an unrepeat- able read could occur resulting in an incorrect value being assigned to cost. But this problem cannot occur when we use REPEATABLE READ. 3. Suppose the same database instance as above and SQL statements shown below (assuming READ UNCOMMITTED can write to the database): UPDATE Catalog SET cost = cost * 0.95 SELECT C.sid, C.pid FROM Catalog C WHERE C.cost = 36.22 When we use READ UNCOMMITTED on the SQL statements above, dirty read oF the value oF cost could occur because the frst SQL statement might not be fnished while the second one is reading. But this problem cannot occur when we use READ UNCOMMITTED.
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 01/17/2012 for the course EGN 4302 taught by Professor Dr.vishak during the Fall '12 term at University of Central Florida.

Page1 / 3

Data Mgmt Lab_Part_56 - 166 Chapter 16 SELECT * FROM...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online