Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Problem 4: SQL Queries (30 pts) Consider the following relations. The primary keys are underlined while the foreign keys are in italic. Hotel (HNum, Hname,

image text in transcribed

Problem 4: SQL Queries (30 pts) Consider the following relations. The primary keys are underlined while the foreign keys are in italic. Hotel (HNum, Hname, Location) Room (RNum, HNum, Type, View, Price) Booking (ID, HNum, GHum, RNum, DateFrom, DateTo) Guest (GNum, Fname, Lname, Gender, DOB, City) Write the corresponding SQL queries for the below questions 1. List fist name, last name and address of all guests in descending order by First name 2. List the name of the hotels located in Paris or Toulouse. 3. List names of hotels that have rooms booked by Steve Martin 4. List all information about the rooms that has a price below the average price of all single rooms 5. For each Hotel, List the total number of Rooms

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

OCA Oracle Database SQL Exam Guide Exam 1Z0-071

Authors: Steve O'Hearn

1st Edition

1259585492, 978-1259585494

More Books

Students also viewed these Databases questions

Question

1. Which is the most abundant gas presented in the atmosphere?

Answered: 1 week ago

Question

5. Discuss the key components of behavior modeling training.

Answered: 1 week ago