Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Problem 3. (20 points) Understanding of Relational Algebra Consider the followin

ID: 3732745 • Letter: P

Question

Problem 3. (20 points) Understanding of Relational Algebra Consider the following relational schema from which the underlined fields represent the keys to represent information about a hotel, employees, rooms, and guests Guest (questld: integer, name: string, address: string) Hotel guests GuestStay(questld: integer check-in-date: date, check-out-date: date, roomld integer) - Guest reservation history Employee (employeeld:integer, e-name: string) Hotel employees Room (roomld: integer, floornumber: integer, room-capacity: integer, emp - Hotel rooms Receptionist (employeeld: integer, desk-type: string, hours-per-day: double) Hotel receptionists Cleaning-Staff (emploveeld: integer, floornumber: integer, hours-per-day: double)- Assignment of floors to clean Cleaning-Assignment (employeeld integer, roomld: integer); Assignment of rooms to ty: Boolean) clean Using this schema, answer the following questions a) (5 pts) Write a relational expression for the following query Find the name and employee number for all employees who are receptionists b) (5 pts) Write a relational expression for the following query: Find the average capacity of rooms in each floor cleaned by the staff member with employee id 123

Explanation / Answer

a)

e-name,employeeId (Employee Receptionist))

is for projection operation and is for join operation. Join is done on common attribute employeeId

b)

floornumber,avg(room-capacity) ( employeeId = 123 floornumber,avg(room-capacity)(Room Cleaning-Staff Employee))

is grouping operator.

Do ask if any doubt. Please upvote if the answer is helpful.

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote