• S
    SwaseekhGATE Preparation
General
  • Dashboard
  • Syllabus
  • Questions
  • Aptitude
  • Mock Tests
  • TCS NQT 2026
Account
  • Pricing
  • Contact
  1. GATE CS
  2. PYQs
  3. Databases

Consider the following two relations, R(A, B) and S(A, C): R: A | B ---+---- 10 | 20 20 | 30 30 | 40 40 | 30 50 | 95 S: A | C ---+---- 10 | 20 20 | 10 30 | 45 40 | 80 The total number of tuples obtained by evaluating the following expression: sigma_{B > A}(R >< S) is ___ A. 1 B. 2 C. 3 D. 4

GATE 2024 · Databases · Relational Algebra · medium

Answer: 3 tuples are returned by the expression sigma_{B > A}(R >< S). Answer: C.

  1. Compute natural join R >< S: Match each R tuple with the S tuple having the same A: R(10,20) + S(10,20) => (10, 20, 20) R(20,30) + S(20,10) => (20, 30, 10) R(30,40) + S(30,45) => (30, 40, 45) R(40,30) + S(40,80) => (40, 30, 80) R(50,95): A=50 not in S => excluded. Join result: 4 tuples.
  2. Apply selection sigma_{B > A}: Check each joined tuple: (10, 20, 20): B=20 > A=10? Yes => KEEP (20, 30, 10): B=30 > A=20? Yes => KEEP (30, 40, 45): B=40 > A=30? Yes => KEEP (40, 30, 80): B=30 > A=40? No => DISCARD Surviving tuples: 3.