Вы находитесь на странице: 1из 2

Relationa Algebra TC DC

Q1.

Q2.

Q3.

Q4.

Q5.

Q6.

Q7. Consider the relational schema given below, where eId of the relation dependent is a foreign key referring to empId of the relation employee.

Assume that every employee has at least one associated dependent in the dependent relation. employee (empId, empName, empAge) dependent(depId, eId, depName, depAge)

Consider the following relational algebra query:

ΠempId(employee)-ΠempId(employee pAge)dependent)

(empId = eID)(empAge

The above query evaluates to the set of empIds of employees whose age is greater than that of

(A)
some dependent.
(B) all dependents.
(C)
some of his/her dependents.
(D) all of his/her dependents.
Q8. Consider the following relational schema.
Students(rollno: integer, sname: string)
Courses(courseno: integer, cname: string)
Registration(rollno: integer, courseno: integer, percent: real)
Which of the following queries are equivalent to this query in English?
“Find the distinct names of all students who score more than 90% in
the course numbered 107”
(I)
SELECT DISTINCT S.sname
FROM Students as S, Registration as R
WHERE R.rollno=S.rollno AND R.courseno=107 AND R.percent >90
(II) Πsname(σcourseno=107 ∧ percent>90 (Registration ⋈ Students))
(III) {T | SStudents, RRegistration ( S.rollno=R.rollno ∧
R.courseno=107 ∧ R.percent>90 ∧T.sname=S.sname)}
(IV) {<SN> | SRRP ( <SR, SN>Students ∧ <SR, 107,
RP>Registration ∧ RP>90)}
(A)
I, II, III and IV
(B) I, II and III only
(C)
I, II and IV only
(D) II, III and IV only
Q9.
Q11.How many tuples does the result of the following relational algebra
of A.
U 
 A.Id >40 v C.Id <15 C
(A)
7
(B) 4
(C) 5
(D) 9

Ankush Saklecha, CSE Gate Trainer, 9685285381, saklecha.ankush@gmail.com

Relationa Algebra TC DC

Q12.
Q18.
The database can be configured to do ordered indexing on Ap or hashing on
Ap.
Which of the following statements is TRUE?
(A)
Ordered indexing will always outperform hashing for both queries
(B)
Hashing will always outperform ordered indexing for both queries
(C)
Hashing will outperform ordered indexing on Q1, but not on Q2
(D)
Hashing will outperform ordered indexing on Q2, but not on Q1.

Q13.

Q14.

Q15.

Q16

Q17.

Q19.

Q20.

Q21.

Q22.

Q23.

Ankush Saklecha, CSE Gate Trainer, 9685285381, saklecha.ankush@gmail.com