Skip to content
Official PYQ · 2000

GATE CS 2000 Q1.23 — Relational Model: Relational Algebra

Explain with AI

Given the relations

  • employee (name, salary, dept-no), and
  • department (dept-no, dept-name,address),

Which of the following queries cannot be expressed using the basic relational algebra operations (σ,π,×,⋈,∪,∩,−)\left(\sigma, \pi,\times ,\Join, \cup, \cap,-\right)?

Choose one option
View worked solution

Answer: C

Basic relational algebra operations (σ,π,×,⋈,∪,∩,−)(\sigma, \pi, \times, \Join, \cup, \cap, -) do not support aggregation functions such as SUM, AVG, COUNT, MIN, or MAX. These require the extended relational algebra operator (the grouping and aggregation operator, G\mathcal{G}).

Let's analyze each option:

  • Option A: Department address of every employee can be expressed as: πname, address(employee⋈dept-nodepartment)\pi_{\text{name, address}}(\text{employee} \Join_{\text{dept-no}} \text{department})
  • Option B: Employees whose name is the same as their department name can be expressed as: σname=dept-name(employee⋈dept-nodepartment)\sigma_{\text{name} = \text{dept-name}}(\text{employee} \Join_{\text{dept-no}} \text{department})
  • Option C: The sum of all employees' salaries requires the aggregation operator G\mathcal{G} (i.e., Gsum(salary)(employee)\mathcal{G}_{\text{sum}(\text{salary})}(\text{employee})), which is not a basic relational algebra operation.
  • Option D: All employees of a given department (e.g., department 'D101') can be expressed as: σdept-no=’D101’(employee)\sigma_{\text{dept-no} = \text{'D101'}}(\text{employee})

Therefore, the query in Option C cannot be expressed using basic relational algebra operations.

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

Published
Report a correction
Keep exploringMore Relational Model: Relational Algebra questions