Skip to main contentSkip to solution

Consider the following two relations:

DANCE:

SNoNameClass
1Aastha7A
2Mahira6A
3Mohit7B
4Sanjay7A

MUSIC:

SNoNameClass
1Mehak8A
2Mahira6A
3Lavanya7A
4Sanjay7A
5Abhay8A

Arrange the following operations in increasing order as per the number of rows they are returning.

A. DANCE U MUSIC

B. DANCE ∩ MUSIC

C. DANCE - MUSIC

D. DANCE X MUSIC

Solution

✅ Correct Option: 3

Union, intersection and difference compare whole rows (SNo, Name, Class). Only (2, Mahira, 6A) and (4, Sanjay, 7A) appear in both relations, so 2 rows are common.

OperationRows
B. DANCE ∩ MUSIC22
C. DANCE - MUSIC4−2=24 - 2 = 2
A. DANCE ∪ MUSIC4+5−2=74 + 5 - 2 = 7
D. DANCE × MUSIC4×5=204 \times 5 = 20

B and C both return 2 rows, so the increasing order is B, C, A, D.

Keyboard Shortcuts

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