Serial : 0. PT_CS_DBMS_02078 Delhi Noida Bhopal Hyderabad Jaipur Lucknow Indore Pune Bhubaneswar Kolkata Patna Web: E-mail: info@madeeasy.in Ph: 0-5262 CLASS TEST 208-9 COMPUTER SCIENCE & IT Subject : DBMS Date of test : 02/07/208 Answer Key. (a) 7. (c). (a) 9. (d) 25. (b) 2. (d) 8. (a). (b) 20. (b) 26. (a). (b) 9. (d) 5. (c) 2. (d) 27. (b). (d) 0. (c) 6. (c) 22. (c) 28. (c) 5. (a). (c) 7. (b) 2. (b) 29. (c) 6. (c) 2. (a) 8. (a) 2. (c) 0. (d)
CT-208 CS DBMS 7 Detailed Explanations. (a) Every student can enroll more than one course. Every course can be enrolled by more than one student. Therefore it s many to many relationship. 2. (d) Both the statements are incorrect. The select operation is commutative i.e. σc ( σ ( )) ( ( )) c R σ 2 c σ 2 c R. Ultimately only those tuples will be selected which satisfy both C and C 2. Hence order does not matter. But Π (projection) operation is not commutative. Π ( Π ( R)) = Π ( R)) if and only if a is substring (or subset) of a 2, otherwise operation would be incorrect. a a2 a. (b) The correct matching is Pseudotransitive rule : If {X Y, YZ W} then XZ W Augmentation rule : If X Y then XZ YZ for any Z Reflexive rule : If X Y, then X Y Union rule : If {X Y and X Z} then X YZ. (d) COUNT ( ) returns a count of the number of rows retrieved, whether or not they contain NULL values. The group functions MAX, SUM and AVG ignore null values and perform their respective operations on non-null values only. 5. (a) For the output to be same as relation A two conditions must be satisfied. (i) A has no duplicates: If A has duplicates then output will not contain duplicates because of DISTINCT keyword (output will not be same as A(a, b)). (ii) B is non-empty: If B(c, d) is empty then cross product of A and B will result empty rows, so is the output (output will not be same as A(a, b)). 6. (c) B + trees are used for indexing because of the following reasons. High fan-out, which allows to direct searches to the leaf level. Leaf nodes are interconnected. Hence I/O cost is reduced drastically for range queries. 7. (c) The user (programmer) ensures that the database is in consistent state after the execution of transactions. Concurrency control manager ensures isolation. Recovery management component ensures atomicity and durability. 8. (a) The following conflicts leads to respective problems WR conflict : Reading uncommitted data. RW conflict : Unrepeatable read. WW conflict : Overwriting uncommitted data. 9. (d) 2PL ensures conflict serializability but may lead to deadlock. Time-stamp concurrency control algorithm is a non-lock concurrency control method. In time-stamp based method, deadlock cannot occur as no transaction ever waits.
8 Computer Science & IT 0. (c) A read-locked item is also called share-locked because other transactions are allowed to read the item. Hence multiple share-lock requests can be granted at the same time.. (c) The number of possible super keys is 2 = 8 These are actually the number of subsets of (A, B and D). Any subset of these three with C would make a super key for relation R. 2. (a) All the functional dependencies, in implied FD set can be derived using given set and hence all are valid.. (a) The canonical cover is {P Q, Q R} These two functional dependencies can functionality determine all the FD s of the relation. The number of FD s in the minimal cover is 2.. (b) This query counts the number of tuples with marks > minimum marks. All the tuples will have uniques marks. Hence only one tuple with minimum marks. Therefore 5 will be the result of the query (5 records will have marks greater than minimum marks). 5. (c) Maximum number of node at st level = Maximum number of node at 2 nd level = (because order is i.e., block pointers) Maximum number of node at rd level = = 6 Maximum number of node at th level = 6 = 6 Maximum number of node at 7 th level = 02 = 096 So total number of nodes = ++6+6+256.+..+096 = 56 6. (c) For B + tree, let n be the degree (n ) Key size + n Block pointer 52 (n ) 8 + 8 n 52 6n = 520 n = is best choice 7. (b) Y is weak entity and hence existence dependent on X. More over Y does not have it s own key and combines it s partial key with key of strong entity in order to have a key. Every Y must appear in X i.e. total participation of Y is required in X. 8. (a) The output of Q and Q 2 would be same. This is because natural join ( ) has an implicit condition similar to condition (PSNGR.TNo = TRN.TNo), in Q for common attribute. The output of Q would contain tuples from both relations which does not satisfy the condition for natural join.
CT-208 CS DBMS 9 Output Q and Q 2 : Output of Q : Pass_Name TNo Type Suresh T SHA Anirudh T SHA Pass_Name TNo Type Suresh T SHA Anirudh T SHA Mallesham T NULL Shiva T NULL NULL T SFA NULL T EXP NULL T RAJ 2 9. (d) It is given that key size + Record pointer size = Record size This makes Blocks size Header Key + Record pointer = Index block factor = Blocks size Header Record size = Database file block factor 20. (b) In M : scenario, the relation will have unique values from the side with cardinality M. Hence when the relations are combined, the key attribute from M-cardinality relation will be the key of new relation. 2. (d) Both S and S 2 are false. S is false because relational algebra can only define DML operations. S 2 is false because relational calculus is declarative procedure. 22. (c) S is false because for set-difference operation, both relations must be union compatible. For performing any set operation on two or more relations, they must be compatible. 2. (b) S is false because if X Y is trivial FD then X Y. In S 2, for relation R candidate key s : AB, BC, CD, AD Prime attributes : A, B, C, D Relation in NF but not BCNF. 2. (c) A schedule is said to be irrecoverable if T i reads A which is updated by uncommitted T j and commit of T i is before T j. The given schedule does not have uncommitted read. So it is recoverable and cascadeless recoverable. 25. (b) According to 2PL, if lock conversion is allowed, then upgrading of locks must be done during expansion phase, and degrading of locks must be done in the shrinking phase. S 2 is true. Lock upgradation is not allowed in shrinking phase therefore S is False.
0 Computer Science & IT 26. (a) T T 2 Clearly we can see the cycle in precedence graph. Therefore this schedule S is not conflict equivalent to any serial schedule. T 27. (b) Even through the R and S may have common attributes it would give output as cross-product unless we give explicit condition for tuple matching. To make it equivalent to natural join we have to use WHERE condition to match the common attributes. 28. (c) The given query finds the pid s of parts that are supplied by atleast four suppliers. Inner query returns the count value and outer query checks whether the count value returned by the inner query is > or not. 29. (c) Update on Null gives Null Average function ignores Null values. Number of non-null entries = So, average will produce 5000 + 6000 + 7000 + 8000 = 6500 0. (d) In level 2 there will be 0 nodes as order is 0. In level there will be 0 0 = 00 nodes In level there will be 0 00 = 000 nodes At level each node will have 9 record pointers. So, therefore the maximum number of records that be indexed are 000 9 = 9000.