Cits1402 10 suppose that a relation r a b c d e

This preview shows page 9 - 12 out of 31 pages.

CITS1402 10. Suppose that a relation R ( A, B, C, D, E ) satisfies the following functional depen- dencies D C, CE A, D A, AE D. Which of the following is a key for the relation R ? (a) AD (b) BE (c) BD (d) BDE (e) CDE lOMoARcPSD|2860748
11. Suppose that a database scheme has two tables R ( A, B ) and S ( B, C ) where all values are integers. Consider the three relational expressions I π A,C ( R ⊲⊳ σ B =1 ( S )) II π A,C ( π A ( R ) × σ B =1 ( S )) III π A ( σ B =1 ( R )) × π C ( σ B =1 ( S )) Which of the following statements about the three expressions is true for all instances of R and S ?
SEE OVER Distributing prohibited | Downloaded by Jia Li ([email protected])
Semester 2 Supplementary/Deferred Examinations February 2016 9. CITS1402 12. The various keywords of a SELECT query must occur in a particular order, or else the query will simply generate a syntax error. Assuming that a query has no subqueries, then which of the following is the correct order? lOMoARcPSD|2860748
13. Suppose that two tables R and S are created with the following MySQL com- mands CREATE TABLE R(c INT PRIMARY KEY, d INT); CREATE TABLE S(a INT PRIMARY KEY, b INT, FOREIGN KEY (b) REFERENCES R(c)); Suppose that R contains the tuples (1 , 1), (2 , 4), (3 , 9) and (4 , 16) while S contains the tuples (0 , 1), (1 , 2) and (2 , 4). Which of the following statements will complete without error? 1. UPDATE R SET c = c+1 WHERE d > 10; 2. INSERT INTO S VALUES (3,7); 3. INSERT INTO S VALUES (2,3);
SEE OVER Distributing prohibited | Downloaded by Jia Li ([email protected])
Semester 2 Supplementary/Deferred Examinations February 2016 10. CITS1402 14. Consider three transactions running at approximately the same time on a table R(x) , where x is of type INT — the COMMIT statements indicate where each transaction ends. SELECT SUM(x) FROM R; COMMIT; INSERT INTO R VALUES(5); INSERT INTO R VALUES(10); INSERT INTO R VALUES(15); COMMIT; DELETE FROM R WHERE x=15; DELETE FROM R WHERE x=10; COMMIT; If the table originally contained integers summing to 100, none of which are 5, 10 or 15, then which of the following values cannot be returned by the first transaction if all three transactions run with isolation level SERIALIZABLE ? (a) 75 (b) 100 (c) 105 (d) 130 (e) All of the values are possible.

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture