Consider the following instance of a relation District – Which of the District…

2024

Consider the following instance of a relation District –

image.png

Which of the District name will be returned by the following relational algebra expression?
πₙₐₘₑ (σₙₐₘₑ≠"AJ" (District)) − [πₙₐₘₑ (σₚₒₚᵤₗₐₜᵢₒₙ>5 (District)) ∩ πₙₐₘₑ (σₙₐₘₑ="AJ" (District))]

  1. A.

    JA,MM

  2. B.

    JA

  3. C.

    JA,AJ

  4. D.

    AJ

  5. E.

    Question not attempted

Attempted by 187 students.

Show answer & explanation

Correct answer: A

Step 1: Apply the selection σₙₐₘₑ≠"AJ" to the relation District. This filters out the row where the name is "AJ", leaving the rows for JA and MM. Step 2: Apply the projection πₙₐₘₑ to get the names of the remaining districts. This gives {JA, MM}. Step 3: Apply σₚₒₚᵤₗₐₜᵢₒₙ>5 to find districts with population greater than 5. Only AJ has population 50, so this gives {AJ}. Step 4: Apply πₙₐₘₑ to get the names of districts with population > 5. This gives {AJ}. Step 5: Apply σₙₐₘₑ="AJ" to get the district with name AJ. This gives {AJ}. Step 6: Apply πₙₐₘₑ to get the name AJ. This gives {AJ}. Step 7: Find the intersection of {AJ} and {AJ}, which is {AJ}. Step 8: Perform the set difference {JA, MM} − {AJ}, which removes AJ from the set, leaving {JA, MM}. Final result: {JA, MM}.

Explore the full course: Up Lt Grade Assistant Teacher 2025