Tencent飞
Tencent飞
全部文章
分类
题解(40)
归档
标签
去牛客网
登录
/
注册
Tencent飞的博客
全部文章
(共40篇)
题解 | #返回产品名称和与之相关的订单号#
SELECT p.prod_name, o.order_num from Products p left join OrderItems o on p.prod_id = o.prod_id order by p.prod_name asc
Mysql
2022-03-11
0
342
题解 | #检索每个顾客的名称和所有的订单号(一)#
select cust_name, order_num from Customers a inner join Orders b on a.cust_id = b.cust_id order by cust_name
Mysql
2022-03-11
0
319
题解 | #检索每个顾客的名称和所有的订单号(二)#
SELECT cust_name, order_num FROM Orders right join Customers on Orders.cust_id = Customers.cust_id order by cust_name
Mysql
2022-03-11
0
275
题解 | #检索每个顾客的名称和所有的订单号(一)#
select a.cust_name , b.order_num from Customers a, Orders b where a.cust_id = b.cust_id order by a.cust_name asc
Mysql
2022-03-11
0
268
题解 | #确定最佳顾客的另一种方式(二)#
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
首页
上一页
1
2
3
4
下一页
末页