Question: Please help on the question: The Hotel Reviews.com database consists of three relations: HOTELS(HID, Category Price), REVIEWERS(RIDAGE), REVIEWS(RID,HID,SCORE). Underlined attributes represent keys for the respective

Please help on the question:

Please help on the question: The Hotel Reviews.com" database consists of three

The Hotel Reviews.com" database consists of three relations: HOTELS(HID, Category Price), REVIEWERS(RIDAGE), REVIEWS(RID,HID,SCORE). Underlined attributes represent keys for the respective relations. Relation REVIEWS has a key that consists of two attributes, RID and HID. Attributes RID and HID in REVIEWS are also foreign keys, w.r.t. attribute RID in relation REVIEWERS and attribute HID in relation HOTELS. Attribute "score" in relation REVIEWS is always a strictly positive integer. The same apply to attribute "age" in relation REVIEWERS and attribute "price" in relation HOTELS. The tables below show a plausible instance of the database: | HOTELS REVIEWERS REVIEWS hid category price rid age rid hid score Astoria Belvedere Vertigo 1 Laguna 5-stars 4-stars 4-stars 3-stars 320 Ada 189 | Bob 179 1 Tom 99 Zoe 33 21 25 21 | Ada Belvedere | Ada Vertigo | Bob Laguna | Bob Vertigo ! | Zoe Belvedere 3 4 4 5 Task to do: A) With respect to the database schema presented above, write a relational algebra expression to identify the CATEGORY and PRICE of all the hotels ever reviewed by Ada. The expected result for the instance given above is hid category price Belvedere Vertigo 4-stars 4-stars 189 179 Your solution must return the appropriate answer for any plausible database instance. B) With respect to the database schema presented above, write a relational calculus expression to identify the RID of all the reviewers who are strictly older than Tom. Your solution must return the appropriate answer for any plausible database instance

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!