GB279824
GB279824
全部文章
分类
归档
标签
去牛客网
登录
/
注册
GB279824的博客
全部文章
(共162篇)
题解 | 返回顾客名称和相关订单号
# select C.cust_name,O.order_num # from Customers C INNER join Orders O ON C.cust_id = O.cust_id # order by C.cust_name ASC,O.order_num ASC; select c...
2025-05-20
0
20
题解 | 从 Products 表中检索所有的产品名称以及对应的销售总数
select prod_name, (select sum(quantity) from OrderItems OI where OI.prod_id = Products.prod_id) as quant_sold from Products
2025-05-20
0
21
题解 | 返回每个顾客不同订单的总金额
select cust_id, (select sum(quantity * item_price) from OrderItems OI where OI.order_num = Orders.order_num) as total_ordered from Orders ...
2025-05-20
0
18
题解 | 返回购买 prod_id 为 BR01 的产品的所有顾客的电子邮件(一)
select cust_email from Customers where cust_id in ( select cust_id from Orders where order_num in ( select order_num from ...
2025-05-20
0
21
题解 | 确定哪些订单购买了 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_dat...
2025-05-20
0
25
题解 | 返回购买价格为 10 美元或以上产品的顾客列表
select cust_id from Orders where order_num in( select order_num from OrderItems where item_price >= 10 );
2025-05-20
0
18
题解 | 计算总和
select order_num, sum(quantity * item_price) as total_price from OrderItems group by order_num having total_price >= 1000 order by order_nu...
2025-05-20
0
17
题解 | 返回订单数量总和不小于100的所有订单的订单号
select order_num from OrderItems group by order_num having sum(quantity) >= 100 order by order_num ASC;
2025-05-20
0
19
题解 | 每个供应商成本最低的产品
select vend_id, min(prod_price) as cheapest_item from Products group by vend_id order by cheapest_item ASC;
2025-05-20
0
21
题解 | 返回每个订单号各有多少行数
select order_num, count(order_num) as order_lines from OrderItems group by order_num order by order_lines ASC;
2025-05-20
0
19
首页
上一页
7
8
9
10
11
12
13
14
15
16
下一页
末页