首页
题库
公司真题
专项练习
面试题库
在线编程
面试
面试经验
AI 模拟面试
简历
求职
学习
基础学习课
实战项目课
求职辅导课
专栏&文章
竞赛
我要招人
发布职位
发布职位、邀约牛人
更多企业解决方案
AI面试、笔试、校招、雇品
HR免费试用AI面试
最新面试提效必备
登录
/
注册
和光同尘cc
腾讯_测试开发
获赞
2414
粉丝
66
关注
13
看过 TA
4482
男
蚌埠坦克学院
2024
Java
IP属地:广东
猛猛划水
私信
关注
拉黑
举报
举报
确定要拉黑和光同尘cc吗?
发布(41)
评论
刷题
收藏
和光同尘cc
关注TA,不错过内容更新
关注
2022-06-01 21:32
腾讯_测试开发
题解 | #统计每个学校各难度的用户平均刷题数#
SELECT t1.university, t3.difficult_level, COUNT(t2.question_id)/COUNT(distinct(t2.device_id)) as avg_answer_cnt FROM user_profile t1, question_practice_detail t2, question_detail t3 WHERE t1.device_id = t2.device_id and t2.question_id = t3.question_id GROUP BY ...
0
点赞
评论
收藏
分享
2022-05-31 15:34
腾讯_测试开发
题解 | #浙江大学用户题目回答情况#
嵌套查询 select device_id,question_id,result from question_practice_detail where device_id = (select device_id from user_profile where university = '浙江大学');
0
点赞
评论
收藏
分享
2022-05-27 20:39
腾讯_测试开发
题解 | #分组过滤练习题#
考察的是** HAVING** 的用法 ○ HAVING 作用:筛选分组后的各组数据(WHERE 关键字无法与聚合函数一起使用) 语法: SELECT column_name, aggregate_function(column_name) FROM table_name WHERE column_name operator value GROUP BY column_name HAVING aggregate_function(column_name) operator value; #### 本题答案: select university, avg...
0
点赞
评论
收藏
分享
2022-05-27 20:00
腾讯_测试开发
题解 | #查找后降序排列#
排坑:升序和降序需要对每个变量单独指定 select device_id,gpa,age from user_profile order by gpa desc,age desc;//单独指定 desc
0
点赞
评论
收藏
分享
2022-05-26 19:34
腾讯_测试开发
题解 | #计算男生人数以及平均GPA#
count 与 avg 统计表中数据 select count(gender) as male_num,avg(gpa) as avg_gpa from user_profile where gender = 'male';
0
点赞
评论
收藏
分享
2022-05-26 18:57
腾讯_测试开发
题解 | #查看学校名称中含北京的用户#
通配符 这里用通配符来查找: %x% 表示包含x在内,通配符要与like搭配使用 select device_id,age,university from user_profile where university like "%北京%";
0
点赞
评论
收藏
分享
2022-05-26 18:51
腾讯_测试开发
题解 | #操作符混合运用#
操作符混用:找出gpa在3.5以上(不包括3.5)的山东大学用户 或 gpa在3.8以上(不包括3.8)的复旦大学同学。 用括号隔开,避免冲突,也提升可读性 select device_id,gender,age,university,gpa from user_profile where (gpa > 3.5 and university = '山东大学') or (gpa > 3.8 and university = '复旦大学');
0
点赞
评论
收藏
分享
2022-05-26 18:47
腾讯_测试开发
题解 | #Where in 和Not in#
WHERE IN select device_id,gender,age,university,gpa from user_profile where university in ('北京大学' , '复旦大学' , '山东大学');
0
点赞
评论
收藏
分享
2022-05-26 16:23
腾讯_测试开发
题解 | #查询结果限制返回行数#
SQL将查询后的列重命名 一开始没看清,以为要更改原表的列名,后来才知道只要更改输出列名,这里用 AS 指定别名就行 SELECT device_id as user_infos_example FROM user_profile WHERE id <= 2;
0
点赞
评论
收藏
分享
2022-05-26 15:33
腾讯_测试开发
题解 | #查询所有列#
SQL查询表中所有列 语法: SELECT * FROM tablename;
0
点赞
评论
收藏
分享
2021-04-16 10:42
腾讯_测试开发
0
点赞
评论
收藏
分享
1
2
3
创作者周榜
更多
关注他的用户也关注了:
牛客网
牛客企业服务