Bigder
Bigder
全部文章
分类
归档
标签
去牛客网
登录
/
注册
Bigder的博客
全部文章
(共33篇)
题解 | #返回2020年1月的所有订单#
select order_num,order_date from Orders where date_format(order_date,'%Y%m') ='202001' order by order_date asc; #【问题】编写 SQL 语句,返回 2020 年 1 月的所有订单的订单号...
2023-05-15
1
266
题解 | #顾客登录名#
select cust_id,cust_name,upper(concat(substring(cust_name,1,2),substring(cust_city,1,3))) as user_login from Customers #【问题】编写 SQL 语句,返回顾客 ID(cust_id)...
2023-05-15
1
297
题解 | #返回顾客名称和相关订单号以及每个订单的总价#
SELECT c.cust_name as cust_name, o.order_num as order_num, SUM(oi.quantity * oi.item_price) as OrderTotal FROM Customers c INNER J...
2023-05-14
1
238
题解 | #返回顾客名称和相关订单号#
select t.cust_name, t1.order_num from Customers t, Orders t1 where t.cust_id = t1.cust_id ORDER BY t.cust_name,t1.order_num asc #编写 SQL 语句,返回 Custom...
2023-05-14
1
372
题解 | #检索所有的产品名称以及对应的销售总数#
select prod_name, SUM(quantity) as quant_sold from Products t, OrderItems t1 where t.prod_id = t1.prod_id group by prod_name #...
2023-05-14
3
335
题解 | #返回每个顾客不同订单的总金额#
select t.cust_id, sum(t2.quantity * t2.item_price) as total_ordered from Orders t, OrderItems t2 where t.order_num = t2.order_num ...
2023-05-14
1
200
题解 | #确定订单#
SELECT t2.cust_id, t2.order_date FROM OrderItems t1, Orders t2 where t1.order_num = t2.order_num and t1.prod_id = "BR01" group by ...
2023-05-14
1
259
题解 | #返回购买价格为 10 美元或以上产品的顾客列表#
select cust_id from Orders where order_num in ( select order_num from OrderItems where item_price >=10)
2023-05-14
2
279
题解 | #计算总和#
select order_num, sum(item_price * quantity) AS total_price from OrderItems group by order_num having sum(item_price * quantity) >= 1000 or...
2023-05-14
1
244
题解 | #返回订单数量总和不小于100的所有订单的订单号#
select order_num from OrderItems group by order_num having sum(quantity) >=100 order by order_num #返回订单数量总和不小于100的所有订单的订单号#
2023-05-14
1
203
首页
上一页
1
2
3
4
下一页
末页