Relational algebra: employees in Sales

December 4, 2026 · Team EasyExamNotes · 1 min read (est.) · 0 comments

Share on WhatsApp

← RGPV CS-502 DBMS December 2025 solved question paper

RGPV CS-502 (GS) | December 2025 | Q5(b) | 7 marks (inferred)

Question (restated): Using EMP(Eid, Dept) and DEPT(Dept, Dname), find employee names working in Sales using relational algebra.

Answer

Important examination note: The supplied EMP schema has no employee-name attribute. Therefore employee names cannot be retrieved from these relations alone. The following expression correctly retrieves employee identifiers using the supplied schema.

π Eid (EMP ⋈ σ Dname = 'Sales' (DEPT))

First select the department tuples with Dname equal to Sales. Next natural join the selected department tuples with EMP on their common attribute Dept. Finally project Eid. For example:

EMP.Eid EMP.Dept
101 D1
102 D2
103 D1
DEPT.Dept Dname
D1 Sales
D2 IT

The selection returns (D1, Sales), the join returns employee IDs 101 and 103 with their department details, and projection returns {101,103}.

If employee names are intended

Assume explicitly that EMP is extended to EMP(Eid, Ename, Dept). Then the expression is:

π Ename (EMP ⋈ σ Dname = 'Sales' (DEPT))

This alternative requires additional data not supplied in the examination. It is not valid against the original schema. The distinction demonstrates why relational algebra expressions must reference attributes that actually exist in their input relations.

DEPT: select Sales; Join EMP on Dept; Project Eid (Ename unavailable)
Relational algebra: employees in Sales

← RGPV CS-502 DBMS December 2025 solved question paper

Discussion

Ask a question, share your thoughts or report an error.

Sign in to participate in the discussion.

Join the discussion