1

The Database has the following tables:

  • Hotel: (hotelNo, hotelName, city)
  • Room: (roomNo, hotelNo, type, price)
  • Booking: (hotelNo, guestNo, dateFrom, dateTo, roomNo)
  • Guest (guestNo, guestName, guestAddress)

Describe the following tuple relational calculus in plain English, as well as, convert it to a relational algebra expression.

{H.hotelName, G.guestName, B1.dateFrom, B2.dateFrom | Hotel(H) ∧Guest(G) ∧ Booking(B1) ∧ Booking(B2) ∧H, hotelNo =B1.hotelNo ∧ G.guestNo = B1.guestNo ∧ B2.hotelNo = B1.hotelNo ∧ B2.guestNo = B1.guestNo ∧B2.dateFrom ≠ B1.dateFrom}

SQB
  • 3,926
  • 2
  • 28
  • 49

1 Answers1

1

All pairs of bookings made by the same person at the same hotel that do not start on the same date.

Chris K
  • 1,703
  • 1
  • 14
  • 26