Database System Concepts
Database System Concepts
7th Edition
ISBN: 9780078022159
Author: Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher: McGraw-Hill Education
Bartleby Related Questions Icon

Related questions

Question
Consider a relational database for an online hotel booking company. The database consisting of
the following tables (where the primary keys are underlined):
 Hotel (hId, hName, hAddress, hCity)
 Guest(gId, gName, gAddress, gCity)
 Room(hid, roomNo, type, price)
 Booking(gId, hId, roomNo, fromDate, year, noOfDays)
Where hId and gId are identifiers for the hotels and the guests,
and the Booking relation indicated that a guest booked a hotel room for a specified number of days
(noOfDays) starting from fromDate of a given year. For instance, a tuple < g12345, h5555, 220,
Jan05, 2016, 15> in Booking indicates that the guest g12345 booked room 220 of the h5555 hotel
for 8 days starting on Jan 5, 2016. The attribute "gAddress" records the home address of the
guests.
Write the following queries in relational algebra 
(1) Return the
name of guests who have booked a hotel room in NYC in January 2016 (i.e.,
fromDate between 01/01 and 01/31 and year=2016).
(2) Return the
name of guests who have booked a hotel room of type “suite” in NYC for longer than
30 days.
(3) Return the
name of guests who never booked a hotel room for longer than 3 days.
(4) Return the ids of the hotels located in NYC which were not booked at all in the year 2015.
(5) Return the ids of the guests who have booked at least one room of type “penthouse suite” in
every hotel located in NYC
Expert Solution
Check Mark
Knowledge Booster
Background pattern image
Computer Science
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
SEE MORE QUESTIONS
Recommended textbooks for you
Text book image
Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education
Text book image
Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON
Text book image
Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON
Text book image
C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON
Text book image
Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning
Text book image
Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education