Tencent飞
Tencent飞
全部文章
题解
归档
标签
去牛客网
登录
/
注册
Tencent飞的博客
全部文章
/ 题解
(共28篇)
题解 | #确定最佳顾客的另一种方式(二)#
select c.cust_name, Orn.total_price from ( select a.order_num, SUM(a.item_price * a.quantity) as total_price from OrderItems a ...
Mysql
2022-03-11
0
305
题解 | #返回顾客名称和相关订单号以及每个订单的总价#
select c.cust_name, o.order_num as order_num, o.OrderTotal as OrderTotal from ( select a.order_num, SUM(a.quantity * a.item_price) as Or...
Mysql
2022-03-11
0
338
题解 | #返回顾客名称和相关订单号#
# 方法一:使用简单的等联结语法 # select c.cust_name, o.order_num # from Customers c, Orders o # where c.cust_id = o.cust_id # order by c.cust_name asc # 方法二:使用inne...
Mysql
2022-03-11
0
399
题解 | #从 Products 表中检索所有的产品名称以及对应的销售总数#
SELECT p.prod_name, o.quant_sold FROM ( SELECT a.prod_id, SUM(a.quantity) as quant_sold from OrderItems a group by a.prod...
Mysql
2022-03-11
5
465
题解 | #返回每个顾客不同订单的总金额#
SELECT o.cust_id as cust_id , tb.total_ordered as total_ordered from ( select a.order_num, SUM(a.item_price * a.quantity) as total...
Mysql
2022-03-11
0
352
题解 | #返回购买 prod_id 为 BR01 的产品的所有顾客的电子邮件(一)#
select c.cust_email from OrderItems a, Orders b, Customers c where a.prod_id = 'BR01' and a.order_num = b.order_num and b.cust_id = c.cust_id
Mysql
2022-03-11
1
336
题解 | #确定哪些订单购买了 prod_id 为 BR01 的产品(一)#
select b.cust_id, b.order_date from OrderItems a, Orders b where a.prod_id = 'BR01' and a.order_num = b.order_num order by b.order_date asc
Mysql
2022-03-11
0
420
题解 | #返回购买价格为 10 美元或以上产品的顾客列表#
select b.cust_id from OrderItems a, Orders b where a.order_num = b.order_num and a.item_price >= 10
Mysql
2022-03-11
33
1414
首页
上一页
1
2
3
下一页
末页