首页
题库
公司真题
专项练习
面试题库
在线编程
面试
面试经验
AI 模拟面试
简历
求职
学习
课程
专栏·文章
竞赛
搜索
我要招人
发布职位
发布职位、邀约牛人
更多企业解决方案
在线笔面试、雇主品牌宣传
登录
/
注册
胆小的柯基在努力
获赞
1
粉丝
0
关注
8
看过 TA
3
门头沟学院
2024
数据分析师
IP属地:湖北
暂未填写个人简介
私信
关注
拉黑
举报
举报
确定要拉黑胆小的柯基在努力吗?
发布(27)
刷题
胆小的柯基在努力
2022-10-11 17:21
已编辑
门头沟学院 电子信息类
题解 | #将两个 SELECT 语句结合起来(一)#
select prod_id, quantity from OrderItems oi where quantity=100 union select prod_id, quantity from OrderItems oi where prod_id like binary 'BNBG%';
0
点赞
评论
收藏
转发
胆小的柯基在努力
2022-10-11 17:10
已编辑
门头沟学院 电子信息类
题解 | #返回产品名称和每一项产品的总订单数#
select prod_name,orders from ( select prod_name, oi.prod_id,count(order_num) as orders from Products p left join OrderItems oi on p.prod_id = oi.prod_id group by prod_name, oi.prod_id) as prod_order order by prod_name;
0
点赞
评论
收藏
转发
胆小的柯基在努力
2022-10-11 16:46
已编辑
门头沟学院 电子信息类
题解 | #确定最佳顾客的另一种方式(二)#
select cust_name,total_price from Customers c join Orders o on c.cust_id = o.cust_id join ( select oi.order_num, sum(item_price*quantity) as total_price from OrderItems oi group by oi.order_num having total_price>=1000 ) as oi_new on oi_new.order_num = o.order_num order by total_...
0
点赞
评论
收藏
转发
胆小的柯基在努力
2022-10-10 21:44
门头沟学院 电子信息类
题解 | #计算总和#
group by与having语句select order_num, sum(item_price*quantity) as total_price from OrderItems group by order_num having total_price >= 1000 order by order_num;
0
点赞
评论
收藏
转发
胆小的柯基在努力
2022-10-09 02:03
已编辑
门头沟学院 电子信息类
题解 | #顾客登录名#
select cust_id, cust_name, UPPER(concat(left(cust_contact,2),left(cust_city,3))) as user_login from Customers;
0
点赞
评论
收藏
转发
胆小的柯基在努力
2022-10-09 01:03
门头沟学院 电子信息类
题解 | #浙大不同难度题目的正确率#
select difficult_level,sum(if(result="right",1,0))/count(result) as correct_rate from user_profile up join question_practice_detail as qpd on up.device_id = qpd.device_id join question_detail as qd on qpd.question_id = qd.question_id where up.university = "浙江大学" group by difficult_level order by co...
0
点赞
评论
收藏
转发
胆小的柯基在努力
2022-10-08 18:10
门头沟学院 电子信息类
题解 | #统计复旦用户8月练题情况#
【知识点】SQL中条件放在on后与where后的区别(参考博客:链接)数据库在通过连接两张或多张表来返回记录时,都会生成一张临时表,然后再将这张临时表返回给用户。在使用LEFT JOIN时,on和where条件的区别如下:1、 on条件是在生成临时表时使用的条件,它不管on中的条件是否为真,都会返回左边表中的记录。2、where条件是在临时表生成好后,再对临时表进行过滤的条件。这时已经没有left join的含义(必须返回左边表的记录)了,条件不为真的就全部过滤掉。可以这样理解:on是在生成连接表的起作用的,where是生成连接表之后对连接表再进行过滤。当使用left join时,无论on的条...
0
点赞
评论
收藏
转发
胆小的柯基在努力
2022-10-07 16:46
门头沟学院 电子信息类
题解 | #计算用户的平均次日留存率#
select count(date2)/count(date1) from (select distinct device_id, date as date1 from question_practice_detail) as d1 left join (select distinct device_id, date_add(date, interval 1 day) as date2 from...
0
点赞
评论
收藏
转发
胆小的柯基在努力
2022-10-07 15:56
门头沟学院 电子信息类
题解 | #查看不同年龄段的用户明细#
select device_id, gender, case when age < 20 then '20岁以下' when age between 20 and 24 then '20-24岁' when age >= ...
0
点赞
评论
收藏
转发
胆小的柯基在努力
2022-10-07 15:42
门头沟学院 电子信息类
题解 | #计算25岁以上和以下的用户数量#
select case when age < 25 then '25岁以下' when age >= 25 then '25岁及以上' when age is null then '25岁以下' end as age_cut,...
0
点赞
评论
收藏
转发
胆小的柯基在努力
2022-10-06 16:30
门头沟学院 电子信息类
题解 | #查找山东大学或者性别为男生的信息#
UNION ALL,连接多个查询结果,不去重 select device_id, gender, age, gpa from user_profile where university = '山东大学' union all select device_id, gender, age, gpa from  ...
0
点赞
评论
收藏
转发
胆小的柯基在努力
2022-10-06 16:21
门头沟学院 电子信息类
题解 | #统计每个用户的平均刷题数#
select university, difficult_level, round(count(qpd.question_id)/count(distinct qpd.device_id),4) as avg_answer_cnt from user_profile up join question_practice_detail qpd on up.device_id = qpd.device_id join&n...
0
点赞
评论
收藏
转发
1
2
工具箱
TA的圈子
暂未加入圈子
TA的圈子
TA的笔记
暂无笔记
TA的笔记
登录
0
天
已登录
0
天
连续登录
0
人
今日访客
牛客网
牛客企业服务