1
GATE CSE 2007
MCQ (Single Correct Answer)
+2
-0.6

Consider the relation employee(name, sex, supervisorName) with name as the key, supervisorName gives the name of the supervisor of the employee under consideration. What does the following Tuple Relational Calculus query produce?

$$\eqalign{ & \{ e.name\,|\,employee(e) \wedge \cr & (\forall x)[\neg employee(x) \vee \cr & x.\sup ervisorName \ne e.name\, \vee \cr & x.sex = 'male']\} \cr} $$
A
Names of employees with a male supervisor.
B
Names of employees with no immediate male subordinates.
C
Names of employees with no immediate female subordinates.
D
Names of employees with a female supervisor.
2
GATE CSE 2007
MCQ (Single Correct Answer)
+2
-0.6
Consider the following relation schemas :

b-Schema = (b-name, b-city, assets)
a-Schema = (a-num, b-name, bal)
d-Schema = (c-name, a-number)

Let branch, account and depositor be respectively instances of the above schemas. Assume that account and depositor relations are much bigger than the branch relation.

Consider the following query:
Пc-nameb-city = “Agra” ⋀ bal < 0 (branch $$ \Join $$ (account $$ \Join $$ depositor))

Which one of the following queries is the most efficient version of the above query ?

A
Пc-namebal < 0b-city = “Agra” branch $$ \Join $$ account) $$ \Join $$ depositor)
B
Пc-nameb-city = “Agra”branch $$ \Join $$ (σbal < 0 account $$ \Join $$ depositor))
C
Пc-nameb-city = “Agra” branch $$ \Join $$ σb-city = “Agra” ⋀ bal < 0 account) $$ \Join $$ depositor)
D
Пc-nameb-city = “Agra” ⋀ bal < 0 account $$ \Join $$ depositor))
3
GATE CSE 2005
MCQ (Single Correct Answer)
+2
-0.6
A table ‘student’ with schema (roll, name, hostel, marks), and another table ‘hobby’ with schema (roll, hobbyname) contains records as shown below:

Table: student

Roll Name Hostel Marks
1798 Manoj Rathod 7 95
2154 Soumic Banerjee 5 68
2369 Gumma Reddy 7 86
2581 Pradeep Pendse 6 92
2643 Suhas Kulkarni 5 78
2711 Nitin Kadam 8 72
2872 Kiran Vora 5 92
2926 Manoj Kunkalikar
5 94
2959 Hemant Karkhanis
7 88
3125 Rajesh Doshi 5 82

Table: hobby

Roll Hobbyname
1798 chess
1798 music
2154 music
2369 swimming
2581 cricket
2643 chess
2643 hockey
2711 volleyball
2872 football
2926 cricket
2959 photography
3125 music
3125 chess

The following SQL query is executed on the above tables:

Select hostel
From student natural join hobby
Where marks > = 75 and roll between 2000 and 3000;

Relations S and H with the same schema as those of these two tables respectively contain the same information as tuples. A new relation S’ is obtained by the following relational algebra operation:

$$\eqalign{ & S' = \prod\nolimits_{hostel} {(({\sigma _{S.roll = H.roll}}} \cr & ({\sigma _{marks > 75\,\,\,and\,\,roll > 2000\,\,and\,\,roll < 3000}}(S))X(H)) \cr} $$

The difference between the number of rows output by the SQL statement and the number of tuples in S’ is

A
6
B
4
C
2
D
0
4
GATE CSE 2004
MCQ (Single Correct Answer)
+2
-0.6
Consider the relation Student (name, sex, marks), where the primary key is shown underlined, pertaining to students in a class that has at least one boy and one girl. What does the following relational algebra expression produce? (Note: ρ is the rename operator). GATE CSE 2004 Database Management System - Relational Algebra Question 19 English
A
names of girl students with the highest marks
B
names of girl students with more marks than some boy student
C
names of girl students with marks not less than some boy student
D
names of girl students with more marks than all the boy students
GATE CSE Subjects
Software Engineering
Web Technologies
EXAM MAP
Medical
NEET
Graduate Aptitude Test in Engineering
GATE CSEGATE ECEGATE EEGATE MEGATE CEGATE PIGATE IN
CBSE
Class 12