冷凡社长
冷凡社长
全部文章
分类
题解(2)
归档
标签
去牛客网
登录
/
注册
冷凡社长的博客
TA的专栏
0篇文章
0人订阅
SQL题解
0篇文章
0人学习
全部文章
(共133篇)
题解 | #从 Customers 表中检索所有的 ID#
select * from Customers 由于结果只有一列,那么使用*就可以,也可以单独写列的名称 mysql默认是不缺分大小写的,但是在配置文件中是可以修改的。
Mysql
2022-08-12
1
273
题解 | #浙大不同难度题目的正确率#
select t2.difficult_level, round(sum(case when t1.result='right' then 1 else 0 end) / count(t1.device_id),4) as correct_rate from user_...
Mysql
2022-08-06
1
194
题解 | #统计复旦用户8月练题情况#
select t1.device_id,t1.university, count(t2.question_id) as question_cnt, sum(case when result='right' then 1 else 0 end) as right_question_cn...
Mysql
2022-07-15
2
245
题解 | #找出每个学校GPA最低的同学#
select device_id,university,gpa from ( select device_id,university,gpa, dense_rank() over(partition by university order by gpa) as ranking ...
Mysql
2022-07-15
0
236
题解 | #计算用户的平均次日留存率#
select round(count(distinct t1.device_id,t1.date)/count(distinct t.device_id,t.date),4) as avg_ret from question_practice_detail t left join question...
Mysql
2022-07-15
21
429
题解 | #计算用户8月每天的练题数量#
select day(date) as day,count(*) as question_cnt from question_practice_detail where year(date)=2021 and month(date)=8 group by day(date) 没有用其他的函数,只用了...
Mysql
2022-07-14
0
259
题解 | #查看不同年龄段的用户明细#
select device_id,gender, case when age >=25 then "25岁及以上" when age >=20 and age < 25 then "20-24岁" when age &l...
Mysql
2022-07-14
0
211
题解 | #计算25岁以上和以下的用户数量#
select case when age >= 25 then "25岁及以上" else "25岁以下" end as age_cut , count(*) as number from user_profile group by case when ...
Mysql
2022-07-14
2
278
题解 | #统计每个用户的平均刷题数#
select t.university,t2.difficult_level, round(count(t1.question_id)/count(distinct t1.device_id),4) as avg_answer_cnt from user_profile t inner jo...
Mysql
2022-07-14
0
172
题解 | #统计每个学校各难度的用户平均刷题数#
select t.university,t2.difficult_level, round(count(t1.question_id)/count(distinct t1.device_id),4) as avg_answer_cnt from user_profile t inner jo...
Mysql
2022-07-14
0
248
首页
上一页
5
6
7
8
9
10
11
12
13
14
下一页
末页