Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Here are the descriptions of three tables Booking, Room, and Hotel. Use them to write the MySQL query below describe Room; + --------- +------- --+---+-

Here are the descriptions of three tables Booking, Room, and Hotel. Use them to write the MySQL query below

image text in transcribed

image text in transcribedimage text in transcribed

describe Room; + --------- +------- --+---+- ----+------ ---+------- + | Field | Type Null | Key | Default Extra + --------- +------- --+---+- ----+------ ---+------- + | roomNo Tint(3) | hotelNo int(4) | type varchar(9) | price decimal(5,2) YES | YES YES YES | NULL NULL, NULL NULL T | | + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - - - - - - - + describe Guest; + -------------- -------------+------+-----+--------+--+ | Field | Type | Null | Key | Default | Extra + ------------ ----------+----+---------+-------+ | | guestNo I int(7) YES | guestName Tvarchar(30) | YES I guestAddress | varchar(50) | YES NULL NULL NULL + - - - - - - - - - - - - - - + - - - - - - - - - - - - - - - - - - - + - - - - - + - - - - - - - - - + - - - - - - - + describe Booking; +----------+--------+------+-----+---------+.......+ | Field Type Null | Key | Default | Extra + - - - - - - - - - - + - - - - - - - + - - - - - + - - - - + - - - - - - - - + - - - - - - - + I | hotelNo int(4) | YES I guestNo Tint(7) | YES dateFrom date YES | dateTo date YES | roomNo int(3) | YES NULL NULL NULL NULL | NULL + - - - - - - - - - - - - - - - - - - - - - - - - - + - - - - - + - - - - - - - - - + - - - - - - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - - - - - - - + 770N | varchar(20) | YES city hotelName | varchar(30) | YEST NULL 770N TI 931 ( DU| ON22704 | + - - - - - - - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | eux | 7znejen | lay N T dki | PLOT: | + - - - - - - - + - - - - - - - - - + - - - - - +-- - - - - - + - - - - - - - - - - - - - + - - - - - - - - - - - + 2270H aquosar 6. Create a view named CheckingOutToday that contains the account information for each guest at the Grosvenor Hotel who is checking out today. The account information should include the guest number, guest name, guest address, room number being checked out of, number of days spent in the room, and the total cost of the stay. You will need to use the DATEDIFF function to calculate the number of dates spent in the room and you will need to do some arithmetic in the field that represents the total cost of the stay. -------+ | guestso | guestName I guestAddress roomNo numDays | total cost | +--------- ------- +--------- -- - - - + - - - - - - - T T - ---+--------------- -------- --------- -----------+

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_2

Step: 3

blur-text-image_3

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

Lab Manual For Database Development

Authors: Rachelle Reese

1st Custom Edition

1256741736, 978-1256741732

More Books

Students also viewed these Databases questions

Question

Would you change the ending of the book? If so, how?

Answered: 1 week ago