- 1、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。。
- 2、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 3、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
- 4、该文档为VIP文档,如果想要下载,成为VIP会员后,下载免费。
- 5、成为VIP后,下载本文档将扣除1次下载权益。下载后,不支持退款、换文档。如有疑问请联系我们。
- 6、成为VIP后,您将拥有八大权益,权益包括:VIP文档下载权益、阅读免打扰、文档格式转换、高级专利检索、专属身份标志、高级客服、多端互通、版权登记。
- 7、VIP文档为合作方或网友上传,每下载1次, 网站将根据用户上传文档的质量评分、类型等,对文档贡献者给予高额补贴、流量扶持。如果你也想贡献VIP文档。上传文档
查看更多
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)
where Hotel contains hotel details and hotelNo is the primary key;
Room contains room details for each hotel and (hotelNo, roomNo) forms the primary key;
Booking contains details of bookings and (hotelNo, guestNo, dateFrom) forms the primary key;
Guest contains guest details and guestNo is the primary key.
1. Create tables
Create each of the above tables using SQL (create primary keys and foreign keys, where appropriate).
2. Populating tables
(1) Insert rows into each of these tables.
(2) Update the price of all rooms by 5%.
3. Simple queries
(1) List full details of all hotels.
(2) List full details of all hotels in Washington.
(3) List the names and addresses of all guests living in Washington, alphabetically ordered by name.
(4) List all double or family rooms with a price below $40.00 per night, in ascending order of price.
(5) List the bookings for which no dateTo has been specified.
4. Aggregate functions
(1) How many hotels are there?
(2) What is the average price of a room?
(3) What is the total revenue per night from all double rooms?
5. Subqueries and joins
List the price and type of all rooms at the Hilton Hotel.
6. Grouping
(1) List the number of rooms in each hotel.
(2) List the number of rooms in each hotel in Washington.
(3) What is the most commonly booked room type for each hotel in Washington?
2
您可能关注的文档
- 典型新兴持久性有机物在区域环境中的分布特及环境风险研究.pdf
- 电池热管理用相变储能材料的研究进展 刘霞.pdf
- 电路、信号与系统考试范围.docx
- 电路相关acoustic emission analysis of high voltage insulation.pdf
- 电路相关Acoustic noise evaluation for overhead line conductors.pdf
- 电路相关Apple grove 750kV project-two year statistical analysis of audible noise from conductors at 775kV and ambient noise data.pdf
- 电路相关Application of pattern recognition techniques to non invasive insulation monitoring.pdf
- 电路相关Audible noise from power lines measurement legislative control and human response.pdf
- 电路相关Audible noise performance of regular and asymmetric bundles and effect of conductor aging on project UHV's three-phase test line.pdf
- 电路相关Characterization of underground cable incipient behavior using time-frequency multi-resolution analysis and artificial neural networks.pdf
最近下载
- 2024年辅警招聘考试题库(含答案).pdf VIP
- 2022年辅警招聘考试题题库(含答案).pdf VIP
- 2.2 第3课时气候特征影响气候的主要因素 课件 2025地理商务星球版八年级上册.ppt
- 2024公安辅警招聘知识考试题(附含答案) .pdf VIP
- 2024—2025学年黑龙江省大庆铁人中学高一上学期第一次月考数学试卷.doc VIP
- dp-modeler v2 0图像快速建模系统使用手册.pdf VIP
- 2022-2023学年黑龙江省大庆铁人中学高一上学期第一次月考地理试题(解析版).docx VIP
- 中国文化概论(第三版)·第二章·第四节明清中国文化的继往与开来.ppt VIP
- 中国文化概论·第二章·第四节明清中国文化的继往与开来.pdf VIP
- 2-2饮茶思源-中国气候的自然特征和影响因素课件2023-2024学年人教版地理八年级上册.pptx VIP
文档评论(0)