Question: Using the Property relational schema ( repeated for your convenience ) : property ( pID , region, county, eircode, numBeds, numBaths, capacity, pricePerNight, petsAllowed, propAmens,

Using the Property relational schema (repeated for your convenience):
property(pID, region, county, eircode, numBeds, numBaths, capacity, pricePerNight, petsAllowed, propAmens, ownrID)
owner(oID, oName, oAddress, oEmail, oPhone)
customer(cID, cName, cAddress, cEmail, cPhone)
propBooking (bID, startDate, endDate, numPpl, totalPrice, custID, propID)
(a) Write relational algebra expressions to satisfy the following information needs:
(i) List the Eircode, price and property amenities of all properties in Co. Wicklow which can accommodate 4 people. (5)
(ii) List the names and addresses of all customers who have a booking for a property where the total price of the booking exceeds 1000 euro. (5)
(b) Given the request: List the names and contact details of all customers who have bookings between 2024-03-01 and 2024-03-31, for properties located in the regions Newport or Achill, which can accommodate 6 people and pets, and have a wood-fire stove as a property amenity.
(i) Write an SQL query (using implicit or explicit joins) which will retrieve the required information. (5)(
(ii) Using the SQL query created in part (i), create a canonical query tree which represents the query. Explain the steps you take to create the tree, highlighting what parts of the SQL query are represented by the different parts of the tree. (6)
(iii) Using the canonical query tree from part (ii), and with respect to heuristic-based optimisation, develop a query tree that represents an efficient evaluation strategy for the SQL query. In the course of your answer:
Explain the steps taken, describing each heuristic used.
Explain why the tree developed will have a more efficient evaluation than the canonical query tree created in part (ii).(9)

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 Finance Questions!