Bigder
Bigder
全部文章
分类
归档
标签
去牛客网
登录
/
注册
Bigder的博客
全部文章
(共33篇)
题解 | #纠错4#
SELECT cust_name, cust_contact, cust_email FROM Customers WHERE cust_state = 'MI' UNION SELECT cust_name, cust_contact, ...
2023-05-16
0
216
题解 | #将两个 SELECT 语句结合起来(二)#
select prod_id,quantity from OrderItems t where t.quantity = 100 union select prod_id, quantity from OrderItems t where t.prod_id like 'B...
2023-05-16
0
530
题解 | #将两个 SELECT 语句结合起来(一)#
SELECT prod_id, quantity FROM OrderItems WHERE quantity = 100 UNION ALL SELECT prod_id, quantity FROM OrderItems WHERE ...
2023-05-16
0
382
题解 | #列出供应商及其可供产品的数量#
select t.vend_id,count(t1.prod_id) as prod_id from Vendors t left join Products t1 on t.vend_id = t1.vend_id group by t.vend_id order by t.vend_id...
2023-05-16
0
494
题解 | #返回产品名称和与之相关的订单号#
#【问题】 使用 OUTER JOIN 联结 Products 表和 OrderItems 表,返回产品名称(prod_name)和与之相关的订单号(order_num)的列表,并按照产品名称升序排序 select prod_name, order_num from Prod...
2023-05-15
0
272
题解 | #检索每个顾客的名称和所有的订单号(二)#
#【问题】检索每个顾客的名称(Customers表中的 cust_name)和所有的订单号(Orders 表中的 order_num), # 列出所有的顾客,即使他们没有下过订单。最后根据顾客姓名cust_name升序返回。 select t.cust_name, t1.order_...
2023-05-15
0
320
题解 | #返回购买价格为 10 美元或以上产品的顾客列表#
select t1.cust_id from OrderItems t inner join Orders t1 on t.order_num = t1.order_num where t.item_price >= '10' #【问题】使用子查询,返回购买价格为10美元或以上产品的顾客列表...
2023-05-15
1
279
题解 | #计算总和#
#【问题】编写 SQL 语句,根据订单号聚合,返回订单总价不小于1000 的所有订单号,最后的结果按订单号进行升序排序 select order_num,sum(item_price*quantity) as total_price from OrderItems group by order_n...
2023-05-15
1
299
题解 | #返回每个订单号各有多少行数#
SELECT order_num, COUNT(order_num) order_lines FROM OrderItems GROUP BY order_num ORDER BY order_lines; #【问题】编写 SQL 语句,返回每个订单号(or...
2023-05-15
1
332
题解 | #确定已售出产品的总数#
select sum(t.quantity) as items_ordered from OrderItems t
2023-05-15
2
278
首页
上一页
1
2
3
4
下一页
末页