Submission: Individual effort and submit
提交:个人努力和提交
Instructions: Try to answer all the questions using what you have learned in class. Please make your query general not data related
尝试用你在课堂上学到的知识来回答所有的问题。请让您的查询一般不涉及数据
Menu
Reservation/Booking预定
Orders 订单
Restaurant 餐厅
Question 1 (3 Points)
Write a relational algebra expression that returns the plate that was ordered from Chipotle along
with their price.
第1题(3分)
编写一个关系代数表达式,返回从Chipotle订购的盘子及其价格。
Question 2 (2.25 Points)
Write a relational algebra expression that returns the name of
each of the 3 stars restaurants along with the plate that has never been ordered from these
restaurants.
写一个关系代数表达式,返回每一家三星餐厅的名字以及从未在这些餐厅点过餐的盘子
餐馆。
Question 3 (1.75 Points)
Write a relational algebra expression that returns the name of the
plate that has never been ordered.
问题3(1.75分)写一个关系代数表达式,返回从未订购过的盘子的名称。
Question 4 (3.8 Points)
Write a relational algebra expression that returns the total number of reservations that are
reserved in a restaurant rated 4.
问题4(3.8分)
编写一个关系代数表达式,返回在等级为4的餐厅中预订的总数量。
Question 5 (4.5 Points)
Write a relational algebra expression that returns the name of the plate that has been ordered
more than 15 times in each restaurant.
问题5(4.5分)
写一个关系代数表达式,返回在每家餐厅订购超过15次的盘子的名称。
Question 6 (5.3 Points)
Write a relational algebra expression that returns the restaurant’s name with its average
plate price that is higher than the average of plate prices in all the restaurants.
问题6(5.3分)
写一个关系代数表达式,返回餐厅的名称,其平均餐盘价格高于所有餐厅餐盘价格的平均值。
Question 7 (4.5 Points)
Write a relational algebra expression that returns the bill (Σ𝑞𝑢𝑎𝑛𝑡𝑖𝑡𝑦 × 𝑝𝑟𝑖𝑐𝑒) for each reservation.
编写一个关系代数表达式,返回账单(∑)𝑞𝑢𝑎𝑛𝑡𝑖𝑡𝑦 × 𝑝𝑟𝑖𝑐𝑒) 每次预订。
Question 8 (4.5 Points)
Write a relational algebra expression that returns the number of the table that never been
reserved in each restaurant
编写一个关系代数表达式,返回每个餐厅中未被预订的表的编号。
Question 9 (5.3 Points)
Write a relational algebra expression that returns the name of the plate that has been ordered
the most from each restaurant.
编写一个关系代数表达式,返回每家餐厅被订购最多的盘子的名称。
Question 10 (5.3 Points)
Write a relational algebra expression that returns the total number of orders placed in each
restaurant between 02/20/2022 and 02/25/2022
编写一个关系代数表达式,返回在02/20/2022和02/25/2022之间在每家餐厅下的订单总数
Question 11 (6 Points)
Write a relational algebra expression that returns the average cost of plates for each restaurant
based on its rating.
编写一个关系代数表达式,根据餐厅的评级返回每家餐厅盘子的平均成本。
Question 12 (3.8 points)
Write a relational algebra expression that returns the most expensive plate (average plate price
is the highest) in each area (use Zip Code)
编写一个关系代数表达式,返回每个地区(使用邮政编码)中最昂贵的盘子(平均盘子价格最高)。