Skip to main contentSkip to solution

Given two tables 'R' and 'S'. What will be the output of R-S?

Solution

✅ Correct Option: 2

R - S is the set difference operation in relational algebra. It returns the tuples that are present in R but not in S.


Option 1: this is the union, R∪SR \cup S.

Option 3: this is the intersection, R∩SR \cap S.

Option 4: this is S−RS - R. Set difference is not commutative, so R−S≠S−RR - S \neq S - R.

Both tables must have the same number of attributes with matching domains (union-compatible) for the difference to be defined.

Keyboard Shortcuts

  • Left arrow: Previous question
  • Right arrow: Next question
  • S key: Jump to solution
  • Q key: Jump to question