Please write a view to list the payment statement with the city name, the total number of hotel rooms in the city with a cheap room (price less than $70), and the total cost if all cheap rooms are booked for all the hotels in the city. The output columns should be city, count, cost, sorted by the total cost from high to low.

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

Please write a
view to list the payment statement with the city name, the total number of hotel
rooms in the city with a cheap room (price less than $70), and the total cost if all cheap rooms are booked
for all the hotels in the city. The output columns should be city, count, cost, sorted by the total cost
from high to low.

[MariaDB [dreamhome]>
+▬▬▬▬▬▬
-+———·
| hotelno | hotelname
+
ch01
ch02
dc01
| fb01
|fb02
|
+-
5 rows in set (0.001 sec)
select * from Hotel;
| Omni Shoreham | London
| Phoenix Park
| Latham
| London |
| Berlin |
| Grosvenor
| Watergate
-+
501 |
fb01
601 |
fb01
701 | ch02
701 | fb01
801 | ch02
901 | dc01
1991 | ch91
1001
dc01
1001 |
fb02
1181 | che1
1101
dc01
1101 | fb02
———
[MariaDB [dreamhome]> select * from Room;
+▬▬▬▬▬▬-
| roomno | hotelno
———
———
➖➖➖➖➖➖+
| price |
-+---
| single | 19.00 |
| double | 29.00 |
| single | 10.00 |
family | 39.00 |
| double | 15.00 |
| single | 18.00 |
| single | 29.99 |
double 30.00 |
type
-+
| city 1
——-
+-
12 rows in set (0.001 sec)
| London |
| Paris
▬▬▬▬▬▬▬▬▬▬▬
| single | 58.00
| family | 59.99 |
| family | 35.00
| double | 86.00 |
-+
Transcribed Image Text:[MariaDB [dreamhome]> +▬▬▬▬▬▬ -+———· | hotelno | hotelname + ch01 ch02 dc01 | fb01 |fb02 | +- 5 rows in set (0.001 sec) select * from Hotel; | Omni Shoreham | London | Phoenix Park | Latham | London | | Berlin | | Grosvenor | Watergate -+ 501 | fb01 601 | fb01 701 | ch02 701 | fb01 801 | ch02 901 | dc01 1991 | ch91 1001 dc01 1001 | fb02 1181 | che1 1101 dc01 1101 | fb02 ——— [MariaDB [dreamhome]> select * from Room; +▬▬▬▬▬▬- | roomno | hotelno ——— ——— ➖➖➖➖➖➖+ | price | -+--- | single | 19.00 | | double | 29.00 | | single | 10.00 | family | 39.00 | | double | 15.00 | | single | 18.00 | | single | 29.99 | double 30.00 | type -+ | city 1 ——- +- 12 rows in set (0.001 sec) | London | | Paris ▬▬▬▬▬▬▬▬▬▬▬ | single | 58.00 | family | 59.99 | | family | 35.00 | double | 86.00 | -+
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps

Blurred answer
Knowledge Booster
Data Binding
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
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education