GATE DA 2026 Q42: Output of a relational algebra expression with natural joins
- Database Management and Warehousing
- 2 marks
- MCQ
- −2/3 if wrong
Question
Consider the given relations , and . The relation has three columns , and . The relation has three columns , and . The relation has two columns and .
| P | Q | R |
|---|---|---|
| P1 | Q1 | R1 |
| P2 | Q2 | R2 |
| P3 | Q3 | R2 |
| P | Q | S |
|---|---|---|
| P1 | Q1 | 2 |
| P1 | Q2 | 5 |
| P2 | Q1 | 6 |
| P3 | Q3 | 1 |
| P | T |
|---|---|
| P1 | T1 |
| P3 | T2 |
| P4 | T3 |
| P4 | NULL |
Consider the relational algebra expression
where denotes natural join operation.
Which of the following options is the correct output for the given expression?
Try it: multiple choice: exactly one correct option
Show answer and explanation
Answer: D (official GATE 2026 final answer key)
Concept used: Natural join matches on all common columns; evaluate each side, then join on P, Q and S.
First step: (on P, Q) gives (P1, Q1, R1, 2) and (P3, Q3, R2, 1); the selection keeps only (P3, Q3, R2, 1), whose S = 1 cannot appear on the right side.
Full step-by-step solution
Detailed working, common mistakes and linked mock tests will be available with a free GATEiit account. Log-in is coming soon.
Share this question
Source: official GATE 2026 DA question paper and final answer key, organised by IIT Guwahati. Question paper · Answer key