comeon!!!
comeon!!!
全部文章
分类
归档
标签
去牛客网
登录
/
注册
comeon!!!的博客
全部文章
(共3篇)
题解 | #统计每种性别的人数#
select substring_index(profile,',',-1) gender,count(substring_index(profile,',',-1)) from user_submit group by substring_index(profile,',',-1); substr...
2024-11-09
0
30
题解 | #统计每个学校的答过题的用户的平均答题数#
select up.university, round(count(qpd.question_id)/count(distinct qpd.device_id),4) avg_answer_cnt from user_profile up join question_practice_detail ...
2024-11-08
0
27
题解 | #计算男生人数以及平均GPA#
select sum(1) as male_num ,avg(gpa) avg_gpa from user_profile where gender='male'; #解题思路:使用1进行统计,如果使用数字类型的使用了sum,那么就会导致会将这些数字加起来。
2024-11-08
0
31