Professional Documents
Culture Documents
96 | Unit 4 • Databases
Test
(A) Retrieve the name and address of employees who π a1 , a2 ... an σ P ( r1 ∪ r2 ∪×…× ∪rm )
(C)
work for the project no ‘Dno’
(B) Retrieve the name and address of all employees π a1 , a2 ... an σ P ( r1r2 ×…× rm )
(D)
who control the ‘Res’ department.
(C) Retrieve the name and address of all employees 20. Let R1(A, B, C) and R2(D, E) be two relation schemas
who work for the ‘Res’ department. with primary keys A and D and C be a foreign key in
(D) None of these R1 referring to R2. Suppose there is no violation of the
above referential integrity constraint in the instances r1
16. Select from the following which closely resembles the and r2, which of the following relational algebra expres-
concept ‘Degree of a relationship’: sion would necessarily produce an empty relation?
(A) Number of entities participating in a relation (A) pD(r2) - pC(r1)
(B) Number of entity types participating in a relation (B) pC(r1) - pE(r2)
(C) Number of strong entity types in a relation (C) pD(r1 C = D r2) - pB(r1)
(D) Number of weak entity types in a relation (D) pC(r1 C = E r2)
7. Consider the following statements in a database:
1 21. Let r be an instance for the schema R = (A, B, C, D). Let
(i) No primary key value can be NULL r1 = π A, B , C ( r )r2 = π A, D ( r ) and S = r1 r2. Also given
(ii) A tuple in one relation which refers to another re- that the decomposition of r into r1 and r2 is lossy, which
lation must refer to an existing tuple in that rela- of the following is true?
tion (A) S ⊂ r (B) r∪s=r
(iii) The value of x determines the value of y in all (C) r ⊂ s (D) r s = s
states of a relation, where x and y are two attrib-
utes of the relation Which of the following combi- 22. Which of the following is/are logical database
nations matches the given statements in order? structures?
(A) Referential integrity, functional dependency, en- (A) Network (B) Tree
tity integrity. (C) Chain (D) All of the above
(B) Functional dependency, entity integrity, referential 23. A relational database management system manages
integrity data in more than one file at a time by using which of
(C) Entity integrity, functional dependency, referential the following combinations?
integrity. (A) Tables and tuples
(D) Entity integrity, referential integrity, functional (B) Relations and tuples
dependency (C) Tables and Relations
8.
1 Consider the following relation schemas: (D) Attributes and tuples
Works (emp_name, comp_name,salary) 24. Let Emp = (Name, ID, ADDRESS, PHONE, SPOUSE,
Livesin (emp_name, street, city) LIVINGAT) be a relation scheme with following FDs,
which one of the following is a key
Location (comp_name, city)
ADDRESS → Phone
Manager (manager_name) SPOUSE → NAME
What is returned by the following relational algebra SPOUSE, ADDRESS → PHONE
expression NAME → ID
π emp _ name (σ comp − name = Time ∧ Works.emp _ name = live sin . emp _ name ) (A) ADDRESS, PHONE
(B) SPOUSE, ADDRESS
(Works Livesin) (C) NAME, SPOUSE
(A) Names of all employees who work for TIME (D) NAME, ADDRESS
(B) Names of all employees of TIME who lives in the
25. Consider the following E-R diagram
same city
(C) Names of people who live in the same city
Sname Quantity Proj_name
(D) None of these
9. Consider the following SQL query:
1
SUPPLIER SUPPLY PROJECT
Select distinct a1, a2, …, an from r1, r2…rm where P
This query is equivalent to one of the following rela- Part_no
tional algebra expression: PART
(A) π a , a ... a σ P (r1 × r2 × ... × rm )
1 2 n
Select the most appropriate statement from the follow-
π a1 , a2 ... an σ P ( r1r2 ×…× rm )
(B)
ing for the above ER diagram:
4.98 | Unit 4 • Databases
(A) Represents a ternary relationship 28. What does the following relational algebra expression
(B) Represents a binary relationship represent?
(C) Represents a ternary relationship with instances of pid ( pid, mob_no(Employee-Guests))
the form (s, j, p) (A) Id of all employees working with the company
(D) Represents 1 – to – many relationships (B) Id of all permanent employees
26. If two relations R1 and R2 are such that they are of the (C) Id of part time employees
same degree and domain of the corresponding fields (D) None of these
are also the same, then which one of the following is Common data for questions 29 and 30:
true about R1 and R2?
29. Let R1 and R2 be two relations with attributes a1 and a2.
(A) R1 ⊂ R2 P1 and P2 be two predicates.
(B) R1 ∪R2 = R2 ∪ R1
Select the expression from the following which is
(C) R1 and R2 are union compatible
wrong:
(D) None of these
σ P1 (σ P1 ( R1 )) → σ P2 (σ P2 ( R1 ))
(A)
Common data questions for 27 and 28: Let Employee σ P1 (π a1 ( R1 )) → π (σ a1 (σ P1 ( R1 )))
and Guests be two relations with attributes (id, mobl_no, (B)
σ P1 ( R1 ∪ R2 ) → σ P1 ( R1 ) ∪ σ P2 ( R2 )
(C)
name, address) and (id, mob–no, comps_working, shifts)
Relations respectively {id, mob_no} is the key for both. π a2 (σ a1 ( R1 )) → σ P1 (π a2 ( R1 ))
(D)
27. Which of the following queries are equivalent? 30. Select from the following corresponding TRC for the
(i) pid (Employee Guests) wrong expression in the above question:
(ii) pid (Employee) pid(Guests)
(A) {t/ ∃u, R1(t[P1]) = R2(u[P1])}
(iii) pid{(Employee-Guest) ∩ Guest-Employee)}
(B) {t/ u, R1(t[P1]) = R1(u[P1])}
A
(iv) pid { pid, mob (Employee) ∩ pid, mob (Guest)}
(A) (ii) and (iii) (B) (ii), (iii) and (iv) (C) {t/ ∃u, R1(t[P1]) ≠ R2(u([P1])}
(C) (i), (ii) and (iv) (D) (ii) and (iv) only (D) {t/(דt∈R1)}
Answer Keys
1. D 2. D 3. C 4. C 5. B 6. B 7. C 8. B 9. B 10. A
11. B 12. C 13. B 14. A 15. C 16. A 17. D 18. C 19. A 20. A
21. C 22. D 23. C 24. B 25. C 26. C 27. C 28. B 29. A 30. B