Skip to content
Official PYQ · 2004

GATE CS 2004 Q51 — Normal Forms

Explain with AI

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: ρ\rho is the rename operator).

πname{σsex=female(Student)}−πname(Student⋈(sex=female∧x=male∧marks≤m)ρn,x,m(Student))\displaystyle \pi_{name} \{\sigma_{sex=female} (\text{Student}) \} - \pi_{name} (\text{Student}\bowtie _{(sex=female \wedge x=male \wedge marks \leq m)} \rho_{n, x, m}(\text{Student}))

Choose one option
View worked solution

Answer: D

To understand the relational algebra expression, let's break it down into two parts around the set difference (−-) operator:

1. Left-hand side (LHS):
πname{σsex=female(Student)}\pi_{name} \{\sigma_{sex=female} (\text{Student}) \} This retrieves the names of all female students in the class.

2. Right-hand side (RHS):
πname(Student⋈(sex=female∧x=male∧marks≤m)ρn,x,m(Student))\pi_{name} (\text{Student}\bowtie _{(sex=female \wedge x=male \wedge marks \leq m)} \rho_{n, x, m}(\text{Student})) Here, the relation is joined with a renamed copy of itself. The join condition pairs a female student with a male student whose marks (mm) are greater than or equal to the female student's marks (marks≤mmarks \leq m). Thus, the RHS retrieves the names of female students who have marks less than or equal to at least one male student.

3. Set Difference (LHS - RHS):
Subtracting the RHS from the LHS yields the names of female students who do not have marks less than or equal to any male student. This represents female students whose marks are strictly greater than those of all male students.

Free practice · Your answers on this page are not saved.

Published
Report a correction
Keep exploringMore Normal Forms questions