Read the following data and answer the question. Consider the relational…

UGC NET 2022

Read the following data and answer the question.

Consider the relational schema of Sailors S, Reserves R, and Boats B.

Table 1: Sailors S

sid

sname

rating

age

22

Dustin

7

45.0

29

Brutus

1

33.0

31

Lubber

8

55.5

32

Andy

8

25.5

58

Rusty

10

35.0

64

Horatio

7

35.0

71

Zorba

10

16.0

74

Horatio

9

35.0

85

Art

3

25.5

95

Bob

3

63.5

Table 2: Reserves R

sid

bid

day

22

101

10/10/98

22

102

10/10/98

22

103

10/8/98

22

104

10/7/98

31

102

11/10/98

31

103

11/6/98

31

104

11/12/98

64

101

9/5/98

64

102

9/8/98

74

103

9/8/98

Table 3: Boats B

bid

bname

color

101

Interlake

blue

102

Interlake

red

103

Clipper

green

104

Marine

red

Which of the following relational algebra query computes the names of sailors who have reserved a red and a green boat ?

  1. A.

    ρ(Tempred, π_sid((σ_color='red'(Boats)) ⋈ Reserves)); ρ(Tempgreen, π_sid((σ_color='green'(Boats)) ⋈ Reserves)); π_sname((Tempred ∩ Tempgreen) ⋈ Sailors)

  2. B.

    𝜌( Tempboats 2, (𝛿 color =  ‘𝑟𝑒𝑑′ Boats )∩(𝛿 color =  ‘𝑔𝑟𝑒𝑒𝑛′ Boats ))𝜋 sname (Tempboats2 ⋈  Reserves)𝜌( Tempboats \ 2, (𝛿_ {color} = \ _{‘𝑟𝑒𝑑′} Boats )∩(𝛿 color = \ _{‘𝑔𝑟𝑒𝑒𝑛′} Boats ))𝜋 _{sname} (Tempboats 2 ⋈  Reserves) \\

  3. C.

    𝜋 sname ((𝛿color =  ′𝑟𝑒𝑑′ Boats )∩(𝛿color =  ′𝑔𝑟𝑒𝑒𝑛′ Boats ) (Tempboats ⋈ Sailors ⋈ Reserves))𝜋 sname ((𝛿_{color} = \ _{ ′𝑟𝑒𝑑′} Boats )∩(𝛿_{color} = \ _{ ′𝑔𝑟𝑒𝑒𝑛′} Boats ) (Tempboats ⋈ Sailors ⋈ Reserves))

  4. D.

    𝜌( Tempboats 2, (𝛿 𝑐𝑜𝑙𝑜𝑟 =  𝑟𝑒𝑑 Boats 𝛿 𝑐𝑜𝑙𝑜𝑟 =  ‘𝑔𝑟𝑒𝑒𝑛′ Boats )𝜋 sname (Tempboats 2 ⋈ sailors)𝜌( Tempboats \ 2, (𝛿 _{𝑐𝑜𝑙𝑜𝑟} = \ _{𝑟𝑒𝑑} Boats 𝛿 _{𝑐𝑜𝑙𝑜𝑟} =\ _{ ‘𝑔𝑟𝑒𝑒𝑛′} Boats )𝜋 _{sname} (Tempboats \ 2 ⋈ sailors)

Attempted by 170 students.

Sign up free to check your answer

Sign up free

Explore the full course: Uppsc Polytechnic Lecturer 2025 Cs

Loading lesson…