Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Do number 4 This task requires writing several queries to the hotel database. The database contains the following relations: RoomType(tid, rtName, nightPrice) Room(tid, rid, Number,

Do number 4 image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
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,444.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 1 Query N1. In which rooms had the same guest stayed more than once? Modify the following expression to achieve the desired result: D A (n gid, rid, sid Stay) xp B (nt gid, rid, sid Stay) 3anpoc N2. Write a query to find guests who stayed in a luxury double before living in a standard double. The expression should return name and email. 3anpoc N3. Find all available rooms that meet one of the following conditions: (1) cost less than 2,000 per night and (2) cost more than 8,000 per night and face the sea 3anpoc N4. Who stayed only in a Standard single? Save the queries in a separate docx file. Add screenshots of the results and the expression trees (the part that fits to your screen) under each query. Submit your report to the educational platform

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database And Expert Systems Applications 33rd International Conference Dexa 2022 Vienna Austria August 22 24 2022 Proceedings Part 1 Lncs 13426

Authors: Christine Strauss ,Alfredo Cuzzocrea ,Gabriele Kotsis ,A Min Tjoa ,Ismail Khalil

1st Edition

3031124227, 978-3031124228

More Books

Students also viewed these Databases questions

Question

What is an interface? What keyword is used to define one?

Answered: 1 week ago