Alina_0229
Alina_0229
全部文章
题解
归档
标签
去牛客网
登录
/
注册
Alina_0229的博客
全部文章
/ 题解
(共77篇)
题解 | #返回购买 prod_id 为 BR01 的产品的所有顾客的电子邮件(二)#
select Customers.cust_email from OrderItems join Orders on OrderItems.order_num = Orders.order_num join Customers on Orders.cust_id = Customers.cust_i...
Mysql
2022-03-10
0
217
题解 | #确定哪些订单购买了 prod_id 为 BR01 的产品(二)#
select Orders.cust_id,Orders.order_date from OrderItems,Orders where OrderItems.order_num = Orders.order_num and OrderItems.prod_id="BR01" order by Or...
Mysql
2022-03-10
0
228
题解 | #返回顾客名称和相关订单号以及每个订单的总价#
select C.cust_name,O.order_num,sum(OI.quantity * OI.item_price) OrderTotal from Customers C join Orders O on C.cust_id =O.cust_id join OrderItems OI o...
Mysql
2022-03-10
0
276
题解 | #返回顾客名称和相关订单号以及每个订单的总价#
select C.cust_name,O.order_num,sum(OI.quantity * OI.item_price) OrderTotal from Customers C join Orders O on C.cust_id =O.cust_id join OrderItems OI o...
Mysql
2022-03-10
1
301
题解 | #返回顾客名称和相关订单号#
select Customers.cust_name,Orders.order_num from Customers,Orders where Customers.cust_id=Orders.cust_id order by Customers.cust_name asc,Orders.order...
Mysql
2022-03-10
0
244
题解 | #从 Products 表中检索所有的产品名称以及对应的销售总数#
select p.prod_name,sum(o.quantity) quant_sold from Products p,OrderItems o where p.prod_id = o.prod_id group by prod_name 将两表进行关联,从关联表中进行查询,最后再分组,依据产品...
Mysql
2022-03-10
2
355
题解 | #返回购买 prod_id 为 BR01 的产品的所有顾客的电子邮件(一)#
三层子查询,先从最里层写,查询到prod_id ="BR01"的订单编号 select order_num from OrderItems where prod_id ="BR01" 查询到prod_id ="BR01"的客户id select cust_id from Orders where o...
Mysql
2022-03-08
0
274
题解 | #确定哪些订单购买了 prod_id 为 BR01 的产品(一)#
获取到prod_id="BR01"的订单号 select order_num from OrderItems where prod_id="BR01" 把需要获取的内容写在外层,将订单编号的条件进行子查询 select cust_id,order_date from Orders where ord...
Mysql
2022-03-08
0
310
题解 | #返回购买价格为 10 美元或以上产品的顾客列表#
item_price>=10的订单号 select * from OrderItems where item_price >=10#查找到》=10美元的订单编号 cust_id(客户id) 从Orders表中查询客户id,当订单编号在OrderItems,价格大于等于10美元 selec...
Mysql
2022-03-08
0
346
题解 | #纠错3#
SELECT order_num, COUNT(order_num) AS items FROM OrderItems GROUP BY order_num HAVING items >= 3 ORDER BY items 这道题需要获取到order_num(订单号)的次数,找到次数大于3的,...
Mysql
2022-03-08
0
264
首页
上一页
1
2
3
4
5
6
7
8
下一页
末页