首页
题库
公司真题
专项练习
面试题库
在线编程
面试
面试经验
AI 模拟面试
简历
求职
课程
基础学习课
实战项目课
求职辅导课
专栏&文章
竞赛
搜索
我要招人
发布职位
发布职位、邀约牛人
更多企业解决方案
在线笔面试、雇主品牌宣传
登录
/
注册
biubiubiu~~~~
获赞
15
粉丝
1
关注
0
看过 TA
5
男
郑州大学
2011
Python
IP属地:未知
e
私信
关注
拉黑
举报
举报
确定要拉黑biubiubiu~~~~吗?
发布(45)
刷题
biubiubiu~~~~
2021-11-05 19:07
Python
题解 | #牛客的课程订单分析(二)#
参考答案 select user_id from order_info where date > '2025-10-15' and status = 'completed' and product_name in ('c++','java','python') group by user_id HAVING count(id)>=2 order by user_id 答案解析 本题对新同学来说难点在于 1.时间的比较 2.分组聚合
0
点赞
评论
收藏
分享
biubiubiu~~~~
2021-11-05 18:55
Python
2021-11-05
在牛客打卡1天,今天学习:刷题 13 道/代码提交 10 次/学习课程 2 节
每日监督打卡
0
点赞
评论
收藏
分享
biubiubiu~~~~
2021-11-05 18:30
Python
题解 | #考试分数(二)#
参考答案 select * from grade g1 where g1.score > ( select AVG(g2.score) from grade g2 where g1.job = g2.job)
0
点赞
评论
收藏
分享
biubiubiu~~~~
2021-11-05 18:15
Python
题解 | #刷题通过的题目排名#
本题解析 考察窗口函数dense_rank() 使用方法:dense_rank() over(order by number desc) 参考答案 select id , number, (DENSE_RANK() over (order by number desc)) as t_rank from passing_number 知识拓展 rank() :[10,10,9] rank(10)=1,rank(9)=3,也就是说,10可以并列第一,但是各占一个排行 dense_rank() :[10,10,9] rank(10)=1,rank(9)=2,两个10并列第一,但是不占排...
0
点赞
评论
收藏
分享
biubiubiu~~~~
2021-11-05 17:57
Python
题解 | #获取有奖金的员工相关信息。#
本题解析 本题考查case....when...then...end语法的应用 和多表联合查询 参考答案 select e.emp_no, e.first_name, e.last_name, eb.btype, s.salary, (case when eb.btype=1 then s.salary*0.1 when eb.btype=2 then s.salary*0.2 else s.salary*0.3 end ) as bonus from employees e,emp_bonus eb,salaries s where s.to_date='9999-01-01' ...
0
点赞
评论
收藏
分享
biubiubiu~~~~
2021-11-05 17:37
Python
题解 | #使用含有关键字exists查找未分配具体部门的员工的所有信息。#
本题解析 考察exists的用法 参考答案 select * from employees e where not exists (select emp_no from dept_emp de where e.emp_no = de.emp_no) 知识拓展 in的用法 select * from employees where emp_no not in (select emp_no from dept_emp )
0
点赞
评论
收藏
分享
biubiubiu~~~~
2021-11-05 17:29
Python
题解 | #分页查询employees表,每5行一页,返回第2页的数据#
参考答案 # 方法一: select * from employees limit 5,5; # 方法二: select * from employees limit 5 offset 5;
0
点赞
评论
收藏
分享
biubiubiu~~~~
2021-11-05 17:22
Python
题解 | #平均工资#
参考答案 #1. 查询到最大,最小salary的数据集 #2. 求出不在这个最大最小数据集的薪水的avg select avg(a.salary) avg_salary from salaries a where a.to_date='9999-01-01' and a.salary not in (select max(b.salary) from salaries b where b.to_date='9999-01-01') and a.salary not in (select min(b.salary) from salaries b where b.to_date='9999-...
0
点赞
评论
收藏
分享
biubiubiu~~~~
2021-11-05 16:56
Python
题解 | #按照dept_no进行汇总#
本题解析 考察GROUP_CONCAT()的使用 参考答案 select dept_no,GROUP_CONCAT(emp_no) as employees FROM dept_emp group by dept_no
0
点赞
评论
收藏
分享
biubiubiu~~~~
2021-11-05 16:51
已编辑
Python
题解 | #获取Employees中的first_name#
参考答案 从右边截取 select first_name from employees order by right(first_name,2) 知识拓展 从左边截取 截取id='10002'员工薪水的前4位作为他的新工资 update employees set salary=left(salary,4) where id='10002'; 另外一种截取方法substr() substr(str,start,num) 注意:start是从1开始,也就是字符串的第一个元素位置不是0,而是1;num是向右截取几位 select first_name from employees o...
0
点赞
评论
收藏
分享
biubiubiu~~~~
2021-11-05 11:49
Python
题解 | #查找字符串 10,A,B 中逗号,出现的次数cnt#
本题解析 两个知识点: char_length() replace() 参考答案 select CHAR_LENGTH('10,A,B')-CHAR_LENGTH(REPLACE('10,A,B',',','')) 答案解析 CHAR_LENGTH('10,A,B') = 6 REPLACE('10,A,B', ',', ' ')=4 //用''替换掉逗号','就变成了10AB
0
点赞
评论
收藏
分享
biubiubiu~~~~
2021-11-05 10:18
Python
题解 | #将所有获取奖金的员工当前的薪水增加10%#
本题解析 本题考察把查询当做条件更新部分表数据 参考答案 update salaries set salary = 1.1*salary where emp_no in (select emp_no from emp_bonus) and salaries.to_date='9999-01-01'
0
点赞
评论
收藏
分享
biubiubiu~~~~
2021-11-04 23:34
Python
题解 | #删除emp_no重复的记录,只保留最小的id对应的记录。#
-本题解析 本题考查解读问题的思维逻辑和对同一张表查询的结果进行删除产生的问题解决能力 参考答案 DELETE FROM titles_test WHERE id NOT IN( SELECT * FROM( SELECT MIN(id) FROM titles_test GROUP BY emp_no) a); 答案解析 1.查找最小id SELECT MIN(id) FROM titles_test GROUP BY emp_no 查询titles_test表中,按照emp_no分组后最小的id,没有重复的id,那么最小或者最大的id就是本身 2.删除不在最小id集...
0
点赞
评论
收藏
分享
biubiubiu~~~~
2021-11-04 22:41
Python
题解 | #在audit表上创建外键约束,其emp_no对应employees_test表的主键id#
-本题解析 考察外键的添加语法 参考答案 ALTER TABLE audit ADD FOREIGN KEY (EMP_no) REFERENCES employees_test (ID)
0
点赞
评论
收藏
分享
biubiubiu~~~~
2021-11-04 19:50
Python
题解 | #构造一个触发器audit_log#
触发器 1.create trigger :创建触发器 2.触发器要说明是在after 还是before事务发生时触发 3.要指明是insert 、delete、update操作 4. on 表名 5.begin和end之间写触发的动作 6. new 关键字表示更新后的表的字段 ,old表示更新前的表的字段 -参考答案 create trigger audit_log after insert on employees_test for each row begin insert into audit values(NEW.ID,NEW.NAME); end 答案解析 for each ...
0
点赞
评论
收藏
分享
1
2
3
工具箱
TA的圈子
暂未加入圈子
TA的圈子
TA的笔记
暂无笔记
TA的笔记
登录
0
天
已登录
0
天
连续登录
0
人
今日访客
牛客网
牛客企业服务