OkMaid
OkMaid
全部文章
分类
题解(34)
归档
标签
去牛客网
登录
/
注册
OkMaid的博客
全部文章
(共70篇)
题解 | #统计每种性别的人数#
第一种比较笨笨 ```select 'female' as gender, count(*) as number from user_submit where profile like '%female' union all select 'm...
Mysql
2022-05-24
0
291
题解 | #计算用户8月每天的练题数量#
```select day(date) as day, count(question_id) as question_cnt from question_practice_detail where month(date) = 08 and year(date) = 2021 group by dat...
Mysql
2022-05-24
0
250
题解 | #计算25岁以上和以下的用户数量#
```select '25岁以下' as age_cut, count(device_id) as number from user_profile where age < 25 or age is null union select '25岁及以上' as age_cut, count(de...
Mysql
2022-05-24
0
296
题解 | #查找山东大学或者性别为男生的信息#
学会了 union all是可以不去重的!! 感谢大佬 select device_id, gender, age, gpa from user_profile where university='山东大学' union all select device_id, gende...
Mysql
2022-05-24
0
299
题解 | #统计每个学校各难度的用户平均刷题数#
select u.university, qd.difficult_level, count(qpd.question_id) / count(distinct qpd.device_id) as avg_answer_cnt from question_practice_detail qpd jo...
Mysql
2022-05-23
0
570
题解 | #统计每个学校的答过题的用户的平均答题数#
select u.university, count(question_id) / count(distinct u.device_id) as avg_answer_cnt from user_profile u right join question_practice_detail q on u...
Mysql
2022-05-23
0
290
题解 | #牛客直播开始时各直播间在线人数#
此题共包含两张表: 表1:course_tb 表2:attend_tb 要解决的问题: 请你统计直播开始时(19:00),各科目的在线人数,按照course_id升序排序 解题思路: 统计直播开始时的在线人数(即进入时间在19:00点前,退出时间在19:00后) 按科目ID分组,course_id...
Mysql
2022-03-02
0
462
题解 | #每类试卷得分前3名#
来自专栏
一、知识点总结 把有用的知识写在前面,以方便自个儿复习观看😊 1)窗口函数:有三种排序方式 rank() over() 1 2 2 4 4 6 (计数排名,跳过相同的几个,eg.没有3没有5) ...
Mysql
2022-02-08
323
5514
题解 | #SQL 9.创建一张新表#
来自专栏
明确考点: 表的创建、修改与删除: 1.1 直接创建表: CREATE TABLE [IF NOT EXISTS] tb_name -- 不存在才创建,存在就跳过 (column_name1 data_type1 -- 列名和类型必选 [ PRIMARY KEY -- 可选的约束,主键 ...
Mysql
2021-11-21
295
8417
题解 | #删除记录(四)#
CREATE TABLE user_info_vip ( id INT (11) PRIMARY KEY auto_increment comment "自增ID", uid INT (11) not n...
Mysql
2021-10-20
7
926
首页
上一页
1
2
3
4
5
6
7
下一页
末页