Question: Using the property relational schema, ( repeated here for your convenience and as described on the previous page ) , write SQL queries to satisfy
Using the property relational schema, repeated here for your convenience and as described on the previous page write SQL queries to satisfy the following information needs:
propertypID region, county, eircode, numBeds, numBaths, capacity, pricePerNight, petsAllowed, propAmens, ownrID
owneroID oName, oAddress, oEmail, oPhone
customercID cName, cAddress, cEmail, cPhone
propBooking bID startDate, endDate, numPpl, totalPrice, custID, propID
a Choosing suitable data types, write the SQL code required to create the propBooking table, including all key constraints. You may assume the other tables already exist in the database.
b List the property details beds baths, price, capacity of all properties in the region Clifden ordered by price per night.
c Using the explicit join syntax, find the start date, end date and total price of the booking by the customer with the name Jenny Joyce
d Using the implicit join syntax, find the total amount of rental money earned by the property owner with the name Andy Walsh from bookings of his rental properties this year since
e List the addresses of properties whose price per night is greater than the average price per night of all properties.
f Find the number of properties which do not have any bookings between the dates and
g For each property, find the number of bookings associated with the property and the total amount earned in rental income per property, for properties in Co Dublin.
h List the names and email addresses of the owners whose properties have had more than bookings this year since
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
