DB 2022

Download as pdf or txt
Download as pdf or txt
You are on page 1of 7

NATIONAL INSTITUTE OF TECHNOLOGY ROURKELA

 Database Engineering CS2008  Mid Sem Spring 2021-22  Pg 7  FM 30  2 Hrs


 Answer ALL questions.  All correct options for a question must be selected to secure marks. 

1. Which of the following is not superkey in a relation with attributes V, W, X, Y, Z and primary key VY? [0.5]

(a) VY

(b) VXYZ

(c) XVWY

(d) WXZ

(e) WVXYZ

(f) V

2. Given basic ER and relational models, which of the following is not correct? [0.5]

(a) A set of fields form a candidate key


(b) An attribute of an entity can be composite
(c) An attribute of an entity can be multivalued
(d) In a row of a relation, an attribute can have more than one value
(e) In a row of a relational table, an attribute cannot have null value
(f) ER models with unary relationships cannot be converted to relational models

3. A relation with attributes A,B (A as primary key and B as foreign key pointing to A), contains the tuples: (2,3),(3,2).
Of course the relation was blank initially and then there had been DML operations on the table for reaching this
state. Which option is true? [1]

(a) (2,3) must have been inserted before (3,2)


(b) (3,2) must have been inserted before (2,3)
(c) Any of the tuple might have been inserted before the other
(d) This is not a valid state of the relation given the key constraints

4. Which is a minimal superkey? [0.5]

(a) Candidate key


(b) Primary key
(c) Surrogate key
(d) Foreign key
(e) Alternate key
(f) None of the other options

5. In ER model, what denotes derived attributes? [0.5]

(a) Double ellipse


(b) Double ellipse connected to entity with double line
(c) Dotted ellipse
(d) Dotted ellipse connected to entity with double line
(e) Double dotted ellipse
(f) Double dotted ellipse connected to entity with double dotted line

6. The correct ascending order of a data-hierarchy [0.5]

(a) Bit - byte - record - field - file - database


(b) Byte - bit - field - record - file - database
(c) Bit - byte - field - record - file - database
(d) Bit - byte - file - record - field - database

7. In a relational model, cardinality and degree are termed as: [0.5]

(a) number of tuples; number of attributes


(b) number of attributes; number of tuples
(c) number of tables; number of tuples
(d) number of constraints; number of attributes
(e) number of constraints; number of tables

8. Let E1 and E2 be two entities in an E-R diagram with simple single-valued attributes, R1 and R2 are two relationships
between E1 and E2, Where R1 is one-to-many and R2 is many-to-many. R1 has one attribute of its own and R2 has
two attributes of its own. What is the minimum number of tables required represent this situation in the relation
model? [1]

(a) 1
(b) 2
(c) 3
(d) 4

9. The maximum number of superkeys for the relation schema R(A,B,D,E) with D as the only key is: [1]

(a) 15
(b) 8
(c) 7
(d) 4

10. Consider the relation schema R(E,F,G,H,I,J,K,L,M,N) and the set of functional dependencies {{E,F}→{G},
F→{I,J}, {E,H}→{K,L}, K→{M},{L}->{N}} on R. Which is key for R? [1]

(a) {E,F}

(b) {E,F,H}

(c) {E,F,K}

(d) {E}

(e) {E,F,H,K,L}

(f) None of other options

11. For a relation R(ABC) with functional dependency set {A->BC, B->C}, which one is false? [1]

(a) There is no redundant FD


(b) There exists extraneous attribute(s) in the FD set
(c) There are 4 superkeys
(d) There is no alternate key
(e) None of the other options

12. Given the set F={X→YZ, YW→Z, Z→X, X→W}, using membership algorithm, to determine if the FD X→W is
redundant in F, how many iterations are required? What is the conclusion? [1]

(a) 2 iterations, X→W is not redundant


(b) 3 iterations, X→W is redundant
(c) 4 iterations, X→W is not redundant
(d) 1 iterations, X→W is redundant
13. Consider the following relation:
X Y Z
4 4 2
1 5 4
2 5 3
3 2 2
Which functional dependency satisfied by the given instance will become invalid if insertion of (3,5,3) is valid in
this instance? [1]
(a) X→YZ
(b) XY→Z

(c) YZ→X

(d) Z→XY
14. Without using which Armstrong’s axiom, can union rule be proven? [0.5]
(a) Augmentation
(b) Transitivity
(c) Reflexivity
(d) None of the other options
15. A relation with two attributes A and B has the functional dependency as F={A→B, B→A}. Which statement is
implied by this dependency? [1]
(a) A is a foreign key to B, and B is a foreign key to A

(b) A is a foreign key to B, or B is a foreign key to A

(c) Both A and B are keys


(d) AB is the primary key
(e) Closure of F has 4 non-trivial functional dependencies
16. Consider the set of relations shown below:
Students: (Regd_No, Name, DOB)
Courses: (Course_ID, Course_name, Tutor)
Results: (Regd_No, Course_ID, Grade)
What will be included within the output of the following SQL query that follows Microsoft SQL Server? [1]
Select Name, TuTor, gradE

from Students, Courses, Results


where STUDENTS. Regd_No = Results. Regd_No
and Courses.Course_ID = Results.Course_ID
and RESULTS.grade = ’PASS’

(a) Compilation Error. Unidentified Characters: TuTor, STUDENTS, gradE, RESULTS

(b) List of some students who passed all courses


(c) List of all students who passed at least one course
(d) List of all students who passed all courses
(e) List of some students who passed at least one course dependencies
(f) List of some students who failed in one course
17. Consider a table Student with attributes Name, Roll_Number, Subject, Marks.
What does the following queries do? [1]
S1. select * from Student where rtrim(ltrim(’ hello ’)) <> trim(’ world ’)
S2. select * from Students where char(65) > char(67)
(a) S1 and S2 both give compile-time errors
(b) S1 and S2 both give run-time errors
(c) S2 executes only after S1 has been executed
(d) S1 and S2 return results which have no relation to each other

18. Consider two Structured Query Statements from the Employee Table.
S1: select * from Employee where 1&2 | 1!=2|2 or upper(’hi’) <> lower(’HI’)
S2: select * from Employee where 1<2 or upper(’HI’) <> lower(’HI’) [1]

(a) S1 syntactically correct statement, but S2 has run-time errors


(b) S2 depends on the result of S1
(c) Upon execution, S2 has null values
(d) S1 and S2 are true

19. On which of the following, the minimum number of relations does not depend when converting a ER model to
relational model? [1]

(a) Optional modality of an entity


(b) Mandatory modality of an entity
(c) total participation of an entity
(d) partial participation of an entity

20. Minimum how many relations and how many foreign keys will be required to convert this ER diagram to relational
model? [1]

(a) 3 relations, 3 foreign keys


(b) 4 relations, 4 foreign keys
(c) 3 relations, 4 foreign keys
(d) 4 relations, 3 foreign keys

21. p = |F+ | for F (functional dependency set) defined on R(ABCD) and F=A→B, B→C, C→D, D→A. Which option is
wrong? [1]

(a) p = 49
(b) p = 128
(c) p = 16
(d) p = 105

22. The following functional dependencies are given : AB→CD, AF→D, DE→F, C→G. F→E. G→A. Which one of the
following options is false? [0.5]

(a) {CF}+ = {ACDEFG}

(b) {BG}+ = {ABCD}

(c) {AF}+ = {ACDEFG}

(d) {AB}+ = {ABCDG}


23. In a schema with attributes A, B, C, D, and E, following set of functional dependencies are given: A→B, A→C,
CD→E, B→D, E→A. Which of the following functional dependencies is not implied by the above set? [0.5]

(a) CD → AC

(b) BD → CD

(c) BC → CD

(d) AC → BC

24. From the following instance of a relation schema R(A,B,C),


A B C
1 1 1
1 1 0
2 3 2
2 3 2
the following can be concluded: [0.5]

(a) A functionally determines B and B functionally determines C


(b) A functionally determines B and B does not functionally determine C
(c) B does not functionally determine C
(d) A does not functionally determine B and B does not functionally determine C

25. SELECT operation in SQL is equivalent to [0.5]

(a) The selection operation in relational algebra


(b) The selection operation in relational algebra, except that SELECT in SQL retains duplicates
(c) The projection operation in relational algebra
(d) The projection operation in relational algebra, except that SELECT in SQL retains duplicates

26. Which one of the following queries always gives the same answer as the nested query shown below:
Select * from R where a in (select S.a from S) [1]

(a) Select R.* from R, S where R.a = S.a

(b) Select distinct R.* from R, S where R.a = S.a

(c) Select R.* from R, (Select distinct a from S) as S1 where R.a = S1.a

(d) Select R.* from R, S where R.a=S.a and is unique R

27. Which of the following is a drawback of conventional file-processing system [0.5]

(a) Data redundancy


(b) Non-atomicity
(c) Access control
(d) Concurrent access

28. To which of the following schema, ER diagram is related? [0.5]

(a) External
(b) Conceptual
(c) Physical
(d) None of the other options

29. Which type of constraint is handled by using foreign key? [0.5]

(a) Referential integrity


(b) Domain constraint
(c) Entity integrity constraint
(d) Uniqueness constraint

30. Which is correct for an identifying relationship [1]

(a) Identifies a relationship


(b) connects a weak entity to identifying entity
(c) can have partial participation of both connecting relationships
(d) handles existence dependency of the weak entity

31. Which statement is false for relational model? [0.5]

(a) There cannot be any two tuples with same values for all attributes
(b) tuples and attributes are unordered
(c) Each tuple in a relation represents one entity in the entity set
(d) None of the other options

32. What is the minimum number of tables a binary relationship will have with one weak entity with (1, 1)
participation in one side and one strong entity with (0, n) participation in the other side, and the relationship
has two multivalued attribute of its own. [1]

33. The ability to query data, as well as insert, delete, and alter tuples, is offered by [1]

(a) TCL
(b) DCL
(c) DDL
(d) DML

34. Which of the following is not an example of DBMS? [0.5]

(a) MySQL
(b) Microsoft Access
(c) IBM DB2
(d) Microsoft Excel

35. Which is not true about Armstrong’s axioms? [1]

(a) They are sound and complete


(b) They are sound but not complete
(c) They are complete but not sound
(d) Soundness implies completeness
(e) Completeness implies soundness

36. Which is example of a derived attribute? [0.5]

(a) Age
(b) Gender
(c) Name
(d) Roll number

37. How to handle a generic multivalued attribute in relational model? [0.5]

(a) Multiple rows in parent table


(b) Separate table with foreign key linking
(c) Separate table without foreign key linking
(d) Multiple columns in parent table

38. Which statement is not true? [1]

(a) Selection is commutative but projection is not


(b) Projection is commutative but selection is not
(c) Union is commutative but intersection is not
(d) Intersection and set difference both are commutative

39. Which statement is true? [1]

(a) DDL can change arity of a relation


(b) DML can change cardinality of a relation
(c) Set difference can be expressed as a derived operation using union and intersection
(d) Union can be expressed as a derived operation using set difference
(e) Intersection can be expressed as a derived operation using set difference

 BEST OF LUCK 

You might also like