Tangxiaoya
Tangxiaoya
全部文章
分类
归档
标签
去牛客网
登录
/
注册
Tangxiaoya的博客
全部文章
(共10篇)
题解 | #查询连续登陆的用户#
select user_id from ( select user_id , count(date_sub(date_1,interval rn day)) num from ( select a.user_id , date(log_time) d...
2024-08-24
6
145
题解 | #某店铺的各商品毛利率及店铺整体毛利率#
with a as ( select product_id, order_id, in_price, cnt, price from tb_order_detail join tb_order_overall using(order_id) join tb_produ...
2023-10-19
0
165
题解 | #某店铺的各商品毛利率及店铺整体毛利率#
with a as ( select product_id, order_id, in_price, cnt, price from tb_order_detail join tb_order_overall using(order_id) join tb_produ...
2023-10-19
0
164
题解 | #纠错4#
SELECT cust_name, cust_contact, cust_email FROM Customers WHERE cust_state in ('MI','IL') ORDER BY cust_name SELECT cust_name, cust_contact, cust_...
2023-08-27
0
356
题解 | #返回产品名称和每一项产品的总订单数#
select prod_name,count(order_num) orders from Products a left join OrderItems b on a.prod_id=b.prod_id group by prod_name order by prod_name
2023-08-27
0
244
题解 | #确定最佳顾客的另一种方式(二)#
select cust_name, sum(item_price*quantity) total_price from OrderItems as a join Orders as b on a.order_num=b.order_num join Customers as c on b.cust_...
2023-08-27
0
290
题解 | #购买了 prod_id 为BR01的产品(二)#
select cust_id, order_date from OrderItems as a join Orders as b on a.order_num=b.order_num where prod_id = 'BR01' order by order_date
2023-08-27
0
305
题解 | #返回顾客名称和相关订单号以及每个订单的总价#
select a.cust_name as cust_name, b.order_num as order_num, sum(item_price*quantity) as OrderTotal from Customers a,Orders b,OrderItems c where a.cust_...
2023-08-27
0
351
题解 | #返回每个顾客不同订单的总金额#
select cust_id, sum(item_price*quantity) as total_ordered from OrderItems as a join Orders as b on a.order_num=b.order_num group by cust_id order by t...
2023-08-27
0
377
题解 | #21年8月份练题总数#
select count(distinct device_id) did_cnt, count(question_id) question_cnt from question_practice_detail where date like '2021-08-%'
2023-08-27
0
213