Question: This task requires writing several queries to the hotel database. The database contains the following relations: RoomType(tid, rtName, nightPrice) Room(tid, rid, Number, s, sea View)

 This task requires writing several queries to the hotel database. The
database contains the following relations: RoomType(tid, rtName, nightPrice) Room(tid, rid, Number, s,
sea View) Stay(sid. gid, rid, start, nights, isFinished) Guest(gid, gName, email, country)

This task requires writing several queries to the hotel database. The database contains the following relations: RoomType(tid, rtName, nightPrice) Room(tid, rid, Number, s, sea View) Stay(sid. gid, rid, start, nights, isFinished) Guest(gid, gName, email, country) Room can belong to one of the following categories: Standard double Standard single Luxury double Family4 Information about guest and a room where he/she lived is placed in the Stay relation. The "isFinished" attribute is 'l' if the guest has already checked out of the room. The seaView attribute is 1 for sea-facing rooms and vice versa - O if only the inner garden is visible from the room. Use the following text to load into the relational calculator: group: Hotel RoomType = { tid:number,rtName:string, nightPrice:number 1. Standard double 2100 2.Standard single 1000 3'Luxury double 8500 4. 'Family4, 4500 ) Room = { tid:number,rid:number, Number:number,s:number,seaView:number 1,11,111,25,0 1,22,112,25,0 4,33,113,40,1 3,44,114,36,1 2,55,115,17,0 3 Guest = { gid:number, gName:string, email:string, country:string 01, Ivan, a007@yandex.sql, Russia 02, Sophie,'sewingandruling@mail.sql. USA 03, Alex,"helper@mail.sql', Russia 04. Nick, big@mail.sql', USA 05, Olga, honesty@yandex.sql', Russia 06, Richard, ihaveawolf@mail.sql', USA 07. Natalya, natashazvezda@mail.sql', Russia 08, Sandra, 'why@mail.sql', USA } Stay = { sid:number gid:number rid: number,start:date nights:number is Finished number 11.4.11.2020-01-07 14,0 12,2,44,2020-01-26,5,0 13,1,33.2020-02-14,3,0 14,3,22 2018-02-21.21,1 15,8,55,2017-01-21,12,1 16,3,33,2018-12-12.7.1 17.3.44.2016-10-10,3,1 18.3,55,2020-03-03,2,0 19,1,33 2017-02-14,3,1 20,4,44,2019-05-05,15,1 21.4.44.2020-01-01,13,1 22.7.55,2017-08-02,1,1 23,5,55,2017-08-02,1,1 24.7.11.2017-01-21,21,1 25,6,33,2019-12-12,2,1 ) Query N1. In which rooms had the same guest stayed more than once? Modify the following expression to achieve the desired result: PA (n gid, rid, sid Stay) pB (regid, rid, sid Stay)

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!