GB279824
GB279824
全部文章
分类
归档
标签
去牛客网
登录
/
注册
GB279824的博客
全部文章
(共162篇)
题解 | 组合 Products 表中的产品名称和 Customers 表中的顾客名称
# select prod_name from Products # union all # select cust_name as prod_name from Customers # order by prod_name ASC; # select prod_name from Produc...
2025-05-21
0
19
题解 | 将两个 SELECT 语句结合起来(二)
select prod_id,quantity from OrderItems where quantity = 100 or prod_id like 'BNBG%' order by prod_id ASC;
2025-05-21
0
18
题解 | 将两个 SELECT 语句结合起来(一)
select prod_id,quantity from OrderItems where quantity = 100 union select prod_id, quantity from OrderItems where prod_id LIKE 'BNBG%' order by pr...
2025-05-21
0
22
题解 | 列出供应商及其可供产品的数量
select vend_id, count(prod_id) as prod_id from Vendors V left join Products P using(vend_id) group by V.vend_id order by V.vend_id ASC;
2025-05-21
0
18
题解 | 返回产品名称和每一项产品的总订单数
select prod_name, count(order_num) as orders from Products P left join OrderItems O using(prod_id) group by prod_name order by prod_name A...
2025-05-21
0
21
题解 | 返回产品名称和与之相关的订单号
select prod_name,order_num from Products P left join OrderItems O using(prod_id) order by prod_name ASC;
2025-05-21
0
26
题解 | 检索每个顾客的名称和所有的订单号(二)
# select cust_name, order_num # from Customers C left join Orders O on C.cust_id = O.cust_id # order by # cust_name ASC; select cust_name, orde...
2025-05-21
0
20
题解 | 检索每个顾客的名称和所有的订单号(一)
select cust_name,order_num from Customers C inner join Orders O on C.cust_id = O.cust_id order by cust_name ASC;
2025-05-21
0
24
题解 | 确定最佳顾客的另一种方式(二)
select cust_name, sum(item_price * quantity) as total_price from OrderItems OI inner join Orders O on OI.order_num = O.order_num inner join Custom...
2025-05-21
0
24
题解 | 返回顾客名称和相关订单号以及每个订单的总价
# select cust_name,O.order_num, # (quantity * item_price) as OrderTotal # from Customers C left join Orders O on C.cust_id = O.cust_id # left...
2025-05-20
0
23
首页
上一页
6
7
8
9
10
11
12
13
14
15
下一页
末页