logo

Crowdly

Question 1. Relational Algebra (10 marks) Given the following set of relatio...

✅ The verified answer to this question is available below. Our community-reviewed solutions help you understand the material better.

Question 1. Relational Algebra (10 marks)

Given the following set of relations, which represent an online holiday rental system where guests book properties owned by hosts. Note that a particular property can only be rented by a single guest at a particular time:

GUEST (guest_id, guest_name, guest_address, guest_mobile)

BOOKING (guest_id, prop_id, booking_startdate, booking_enddate, booking_totalguest)

PROPERTY (prop_id, prop_streetaddress, prop_city, prop_state, prop_capacity, prop_pricepernight, prop_cleaningfee, host_id)

HOST (host_id, host_name, host_mobile, host_email)

Write the relational algebra for the following queries (your answer must show an understanding of query efficiency).

List of symbols for copying/pasting as you enter your answers below:

project: π  select: σ  join:  intersectunion   minus -

 (a) List the street address, city, and state of all properties which were booked by a guest named ‘Jack Kaniva’. You may assume that there is only one guest who has such a name [4 marks]

(b) List the name, address, and mobile number of guests who were hosted by ‘Ian McCain’ between 01-Mar-2022 and 31-May-2022 inclusive (i.e. the booking start date is within this range). You may assume that there is only one host who has such a name [6 marks]

More questions like this

Want instant access to all verified answers on learning.monash.edu?

Get Unlimited Answers To Exam Questions - Install Crowdly Extension Now!