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
The following tables form part of a database held in a relational DBMS:
Hotel (hotelNo, hotelName, city)
Room (roomNo, hotelNo, type, price)
Booking (hotelNo, guestNo, dateFrom, dateTo, roomNo)
Guest (guestNo, guestName, guestAddress)
• Hotel contains hotel details and hotelNo is the primary key;
• Room contains room details for each hotel and (roomNo, hotelNo) forms the primary
key;
• Booking contains details of the bookings and (hotelNo, guestNo, dateFrom) forms the
primary key;
• Guest contains guest details and guestNo is the primary key.
Download and install PostgreSQL (Version 14.5). Create the tables for the four rela-
tions using the integrity enhancement features of SQL (using the “CREATE TABLE” state-
ments) and populate at least 5 tuples for each relation (using the “INSERT” statements)
in PostgreSQL. Please report the screenshots of these SQL statements generated from
PostgreSQL.
Run the SQL statements for the following queries and report the screenshots
of these SQL statements and the results generated from PostgreSQL.
(a) List the roomNo, type, and price of the Biltmore Hotel (using subquery) (or a specific
hotel name in your database).
(b) What is the average price of a room?
(c) List the guestNo and gusetName of guests who live in Chicago or Seattle, alphabetically
ordered by their names.
(d) List the number of rooms in each hotel in Kansas City.
(e) List full details of every room in Room relation.
(f) Update the price of all rooms by 8% and then list full details of every room in Room
relation. Compare the output with the output in (e).
 
 
Expert Solution
Check Mark
Still need help?
Follow-up Questions
Read through expert solutions to related follow-up questions below.
Follow-up Question

it says relation hotel already exist

Solution
Bartleby Expert
by Bartleby Expert
SEE SOLUTION
Follow-up Questions
Read through expert solutions to related follow-up questions below.
Follow-up Question

it says relation hotel already exist

Solution
Bartleby Expert
by Bartleby Expert
SEE SOLUTION
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
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