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).

Database Systems: Design, Implementation, & Management
12th Edition
ISBN:9781305627482
Author:Carlos Coronel, Steven Morris
Publisher:Carlos Coronel, Steven Morris
Chapter10: Transaction Management And Concurrency Control
Section: Chapter Questions
Problem 6P
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
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps

Blurred answer
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
SEE SOLUTION
Knowledge Booster
Table
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.
Recommended textbooks for you
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781305627482
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781285196145
Author:
Steven, Steven Morris, Carlos Coronel, Carlos, Coronel, Carlos; Morris, Carlos Coronel and Steven Morris, Carlos Coronel; Steven Morris, Steven Morris; Carlos Coronel
Publisher:
Cengage Learning
A Guide to SQL
A Guide to SQL
Computer Science
ISBN:
9781111527273
Author:
Philip J. Pratt
Publisher:
Course Technology Ptr
Fundamentals of Information Systems
Fundamentals of Information Systems
Computer Science
ISBN:
9781337097536
Author:
Ralph Stair, George Reynolds
Publisher:
Cengage Learning
Principles of Information Systems (MindTap Course…
Principles of Information Systems (MindTap Course…
Computer Science
ISBN:
9781305971776
Author:
Ralph Stair, George Reynolds
Publisher:
Cengage Learning
Principles of Information Systems (MindTap Course…
Principles of Information Systems (MindTap Course…
Computer Science
ISBN:
9781285867168
Author:
Ralph Stair, George Reynolds
Publisher:
Cengage Learning