landf31
landf31
全部文章
分类
题解(71)
归档
标签
去牛客网
登录
/
注册
landf31的博客
TA的专栏
1篇文章
0人订阅
刷题笔记
1篇文章
592人学习
全部文章
(共19篇)
题解 | #返回购买 prod_id 为 BR01 的产品的所有顾客的电子邮件(二)#
select cust_email from Orders inner join OrderItems using(order_num) inner join Customers using(cust_id) where prod_id='BR01'; select cust_email fro...
Mysql
2022-04-06
0
327
题解 | #确定哪些订单购买了 prod_id 为 BR01 的产品(二)#
select cust_id,order_date from Orders where order_num in (select order_num from OrderItems where prod_id='BR01') order by order_date; select cust_i...
Mysql
2022-04-06
0
285
题解 | #返回顾客名称和相关订单号以及每个订单的总价#
order_num 两个表都有,需要指明使用的是哪个表 SELECT cust_name, Orders.order_num, SUM(quantity * item_price) AS OrderTotal FROM Customers INNER JOIN Orders on Customer...
Mysql
2022-04-06
0
351
题解 | #返回顾客名称和相关订单号以及每个订单的总价#
SELECT cust_name, order_num, SUM(quantity * item_price) AS OrderTotal FROM Customers INNER JOIN Orders USING(cust_id) INNER JOIN OrderItems USING(ord...
Mysql
2022-04-06
0
288
题解 | #返回顾客名称和相关订单号#
select cust_name, order_num from Customers inner join Orders on Customers.cust_id=Orders.cust_id order by cust_name,order_num;
Mysql
2022-04-06
0
343
题解 | #返回购买价格为 10 美元或以上产品的顾客列表#
select prod_name, sum(quantity) as quant_sold from Products , OrderItems where Products.prod_id = OrderItems.prod_id group by prod_name
Mysql
2022-04-05
0
248
题解 | #返回购买价格为 10 美元或以上产品的顾客列表#
select cust_email from Customers where cust_id in (select cust_id from Orders where order_num in (select order_num from OrderItems...
Mysql
2022-04-05
0
264
题解 | #返回购买价格为 10 美元或以上产品的顾客列表#
select cust_id from Orders where order_num in (select order_num from OrderItems where item_price>=10);
Mysql
2022-04-05
0
315
题解 | #纠错3#
SELECT order_num, COUNT(*) AS items FROM OrderItems GROUP BY order_num HAVING COUNT(*) >= 3 ORDER BY items, order_num;
Mysql
2022-04-05
0
262
题解 | #每个供应商成本最低的产品#
select vend_id,min(prod_price) as cheapest_item from Products group by vend_id having cheapest_item order by cheapest_item;
Mysql
2022-04-05
0
343
首页
上一页
1
2
下一页
末页