Question: Please help wtih relational algebra: please don't copy paste any answer that you find in chegg. I have already checked the other answer but I

Please help wtih relational algebra: please don't copy paste any answer that you find in chegg. I have already checked the other answer but I want another input.

Thank you!

Model:

For this lab, you'll be using the following relational model to answer queries using relational algebra:

Hotel(hID, hName, city) primary key is hID Guest(gID, gName, gAddress) primary key is gID Room(hID, rNumber, price) primary key is (hID, rNumber). hID is a foreign key to Hotel relation Book(gID, hID, rNumber, StartDate, EndDate) primary key is all attributes! (hID, rNumber) is a foreign key to Room relation gID is a foreign key to Guest relation.

Queries:

  1. Select hotels with at least 1 room with price > $1000.
  2. Select hotels with at least 2 rooms with price > $1000.
  3. Select hotel names with at least 2 rooms with price > $1000.
  4. Select cities that have at least 2 hotels.
  5. Select guests who have reserved a room with price > $1000 (VIPs).

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!