← RGPV CS-502 DBMS December 2024 solved question paper
← RGPV CS-502 DBMS June 2026 solved question paper
← RGPV CS-502 DBMS May 2024 solved question paper
← RGPV CS-502 DBMS November 2019 solved question paper
RGPV Previous Year Examination Question
B.Tech. V Semester | CS-502 (GS) | December 2024 | 4(a)
Question (restated): Explain SELECT, PROJECT and UNION operators in detail, using examples.
Answer
Relational algebra
Relational algebra is a procedural query language in which operators take relations as input and produce relations as output. SELECT, PROJECT and UNION are fundamental operations used to retrieve and combine data.
Sample relation: Student
| ID | Name | Dept | Marks |
|---|---|---|---|
| 1 | Amit | CSE | 82 |
| 2 | Priya | IT | 68 |
| 3 | Rahul | CSE | 91 |
1. SELECT (σ)
Selection retrieves rows satisfying a predicate without changing the relation’s attributes. The expression σ(Marks > 75)(Student) returns the complete rows for Amit and Rahul. Conditions can be combined using AND, OR and NOT. Selection is horizontal filtering and is analogous to the WHERE clause of SQL.
2. PROJECT (π)
Projection retrieves specified attributes and removes duplicate tuples under classical relational algebra. The expression π(Dept)(Student) returns CSE and IT, not three rows. Projection is vertical filtering. SQL requires DISTINCT to reproduce this duplicate elimination explicitly.
3. UNION (∪)
Union returns tuples present in either of two union-compatible relations. They must have the same degree and compatible corresponding attribute domains. If A(ID) contains {1, 2} and B(ID) contains {2, 3}, A ∪ B returns {1, 2, 3}. Duplicate tuples occur only once.
Equivalent SQL
SELECT * FROM Student WHERE Marks > 75; SELECT DISTINCT Dept FROM Student; SELECT ID FROM A UNION SELECT ID FROM B;
Comparison
| Operator | Inputs | Effect |
|---|---|---|
| SELECT | One relation | Filters rows |
| PROJECT | One relation | Chooses columns |
| UNION | Two compatible relations | Combines tuples |
Because each operation returns a relation, operations can be composed. For example π(Name)(σ(Marks > 75)(Student)) returns only the names of qualifying students. This closure property enables complex relational queries.
Further reading
Silberschatz, Korth and Sudarshan, Database System Concepts; Elmasri and Navathe, Fundamentals of Database Systems.
June 2026 examination: additional answer
RGPV CS-502 (GS) | June 2026 | Q4(a) | 7 marks (inferred)
Question (restated): Explain relational algebra operations used in database query processing.
Answer

Relational algebra is a procedural formalism whose operators take relations as input and return relations. Selection σ filters tuples; projection π selects attributes and removes duplicates under set semantics. Union ∪, intersection ∩ and difference − require union-compatible relations. Cartesian product × combines every tuple pair. Rename ρ changes relation or attribute names. Joins combine tuples satisfying a condition; division expresses queries involving all required values.
Let Student contain (1,Asha,10), (2,Ravi,20), (3,Neha,10), with attributes ID, Name, Dept. Department contains (10,CSE), (20,ECE). Selection σ Dept=10(Student) returns Asha and Neha with all attributes. Projection π Name of that result returns only their names. A join on Dept returns department names alongside students.
| Name | Department |
|---|---|
| Asha | CSE |
| Ravi | ECE |
| Neha | CSE |
If A={1,2} and B={2,3}, union gives {1,2,3}, intersection {2}, and difference A−B gives {1}. For division, Enrollment(StudentID, CourseID) divided by Required(CourseID) returns students enrolled in every required course.
The optimizer translates SQL into logical operators and transforms equivalent expressions. Pushing selection below a join can reduce intermediate tuples. SQL commonly uses bag semantics and nulls, so algebraic transformations must respect those differences.
May 2024 — Q4(b)
Question (restated): Explain SELECT, PROJECT and UNION with examples.
Answer
Selection σ filters rows according to a predicate; projection π chooses columns and removes duplicate tuples under classical set semantics. Union ∪ combines tuples from two union-compatible relations, requiring the same arity and compatible corresponding domains. Suppose STUDENT contains (1,Asha,80), (2,Ravi,55), (3,Meera,75). Selection σ Marks>60 returns Asha and Meera with all attributes. Projection π Name returns Asha, Ravi and Meera. If CLUB_A(Sid) contains {1,2} and CLUB_B(Sid) contains {2,3}, their union is {1,2,3}. Selection is horizontal filtering; projection is vertical filtering; union combines compatible sets. SQL SELECT DISTINCT Name corresponds to classical projection, whereas SQL SELECT without DISTINCT may preserve duplicates. SQL UNION removes duplicates; UNION ALL retains them. These operations compose, for example projecting names after selecting high-scoring students.

November 2019 – Question 3(b)
Question (restated): Explain selection, projection and division with examples.
Answer
Selection σ filters rows; projection π selects attributes and eliminates duplicates in classical relational algebra. Division finds values related to every value in another relation.
Enrollment(Student,Course) = {(A,DBMS),(A,OS),(B,DBMS),(C,OS)}. Required(Course) = {(DBMS),(OS)}.
| Expression | Result |
|---|---|
| σ Course=DBMS (Enrollment) | (A,DBMS), (B,DBMS) |
| π Student (Enrollment) | A, B, C |
| Enrollment ÷ Required | A |
Division can be expressed as πStudent(E) − πStudent((πStudent(E) × Required) − E). The inner difference identifies missing required courses, and the outer difference removes students with any missing course.
← RGPV CS-502 DBMS December 2024 solved question paper
← RGPV CS-502 DBMS June 2026 solved question paper
Discussion
Ask a question, share your thoughts or report an error.
Sign in to participate in the discussion.
Join the discussion