Qinglian
• Home Page
• Assignments Due • Progress Report
• Handouts
• Tutorials
• Homeworks
• Lab Projects
• Log Out
Help
Copyright © 2007-2021 Gradiance Corporation.
Gradiance Online Accelerated Learning
Spring-21 HW6
Number of questions: 4 Positive points per question: 25.0 Negative points per question: 0.0
1. Consider the following transactions:
R: [X := X + 15; Y := Y – 10]
S: [X := X – 5; Y := X + 5]
T: [X := X * 2; Y := Y * 3]
Assuming initial values of X = 10 and Y = 20, which of the following is a possible state of the database resulting from a serializable execution of R, S and T?
a) X = 30; Y = 50
b) X = 45; Y = 50
c) X = 40; Y = 20
d) X = 30; Y = 75
2.
Above is a grant diagram involving users A through D and a single privilege P. Suppose A executes
REVOKE P FROM C CASCADE
Compute the resulting grant diagram. Then, tell which of the following is a consequence of the revocation?
a) The revocation is rejected by the system, and all privileges remain as they were
b) D no longer has privilege P
c) The revocation is accepted by the system, but neither B, D, nor E lose privilege P
d) A no longer has privilege P
3. In order to execute the following SQL statement:
UPDATE S
SET c = ‘New York’
WHERE a IN (SELECT a FROM R) AND EXISTS (SELECT b FROM T WHERE T.a > S.a);
Which of the following privileges is not useful in allowing the above statement to be executed?
To be precise, say a privilege P is useful if there is some set of other privileges such that the statement cannot be executed with just those privileges, but if we add privilege P, then the statement can be executed.
a) SELECT on T
b) SELECT on T(a)
c) REFERENCES on R
d) UPDATE on S(c)
4. The relation R(x) consists of a set of integers — that is, one-component tuples with an integer component.
Alice’s transaction is a query:
SELECT SUM(x)
FROM R; COMMIT;
Betty’s transaction is a sequence of inserts: INSERT INTO R VALUES(10);
INSERT INTO R VALUES(50);
INSERT INTO R VALUES(70); COMMIT;
Carol’s transaction is a sequence of deletes: DELETE FROM R WHERE x=70; DELETE FROM R WHERE x=50; COMMIT;
Before any of these transactions execute, the sum of the integers in R is 5000, and none of these integers are 10, 50, or 70. If Alice’s, Betty’s, and Carol’s transactions run at about the same time, and each runs under isolation level READ COMMITTED, which of these sums could be produced by Alice’s transaction?
a) 5070 b) 5000 c) 4940 d) 5120
Submit Homework