Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

1. Give the IDs and names of all guests from Los Angeles who are less than 30 years old, in alphabetical order 2. Give the

image text in transcribed

image text in transcribed

1. Give the IDs and names of all guests from Los Angeles who are less than 30 years old, in alphabetical order

2. Give the starting date and guest ID of all reservations made at a hotel named Marriott

3. Give total number of nights for all reservations made by guests named smith.

4. for each hotel, display ID of the hotel and the number of reservations that have been made at it. Order the results from the hotels that have had the most reservations made at them to the hotels that have the fewest.

FOR QUESTIONS 7-10, CONSIDER THE FOLLOWING DATABASE SCHEMA AND INSTANCE, AND WRITE AN SQL QUERY TO SOLVE EACH PROBLEM: GUEST(GID Name , City, Age ) RESERVATION ( GuestID HotelID, StartDate, Nights) HOTEL (HID Name , City, Rate) The GUEST table stores information on guests making reservations at various hotels, and the HOTEL table stores information on the hotels at which they make reservations. Each row of the RESERVATION table represents a reservation made by a particular guest at a particular hotel on a particular date. GUEST GID Name City Age 011 Smith New York 35 502 Al Amadi New York 40 443 Smith Los Angeles 25 123 Martinez Los Angeles 52 620 Huang Los Angeles Rajaraman Denver 32 28 814 HOTEL HID 01 03 51 21 Name City Marriott New York Days Inn Orlando Marriott Washington Plaza New York Holiday Inn Orlando Holiday Inn Miami Rate 350 175 450 600 225 275 40 38 Nights RESERVATION GuestID Hotell 011 21 011 51 StartDate 01-JAN-20 01-JAN-21 02-DEC-19 2 2 1 814 01 5 4 443 21 21-OCT-17 443 40 30-SEP-17 4 123 51 15-JAN-19 1 123 38 14-JUL-19 2 123 21 15-NOV-18 2 7. Give the IDs and names of all guests from Los Angeles who are less than 30 years old, in alphabetical order

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

Introduction To Constraint Databases

Authors: Peter Revesz

1st Edition

1441931554, 978-1441931559

More Books

Students also viewed these Databases questions

Question

S., whare F=

Answered: 1 week ago

Question

Introduce and define metals and nonmetals and explain with examples

Answered: 1 week ago

Question

What is IUPAC system? Name organic compounds using IUPAC system.

Answered: 1 week ago

Question

What happens when carbonate and hydrogen react with carbonate?

Answered: 1 week ago