不做造粪机器
不做造粪机器
全部文章
分类
归档
标签
去牛客网
登录
/
注册
不做造粪机器的博客
全部文章
(共95篇)
题解 | #平均工资#
select (sum(salary)-min(salary)-max(salary))/(count(*)-2) avg_salary from salaries where to_date='9999-01-01' 剔除最大值和最小值,直接用max和min函数就可以
2024-07-23
1
167
题解 | #按照dept_no进行汇总 易错题#
select dept_no,group_concat(emp_no) employees from dept_emp group by dept_no 聚合函数group_concat(X,Y),其中X是要连接的字段,Y是连接时用的符号,可省略,默认为逗号。group_concat也是一个聚合函数...
2024-07-23
1
144
题解 | #利用最后两个字母排序 易错题#
select first_name from employees order by right(first_name,2) https://blog.nowcoder.net/n/48f16956e11f4dbb94565302417d8326
2024-07-22
1
151
题解 | #查找字符串中逗号出现的次数 易错#
select id, length(string)-length(replace(string,',','')) cnt from strings 使用length 和 replace函数配合得到逗号个数
2024-07-22
1
139
题解 | #将姓名通过(\')连接起来。#
select concat(last_name,'\'',first_name) from employees 使用反斜杠输出引号
2024-07-22
1
169
题解 | #将所有获取奖金的员工当前的薪水增加10%#
update salaries s set s.salary=s.salary*1.1 where s.emp_no in(select emp_no from emp_bonus) and to_date='9999-01-01'
2024-07-22
1
154
题解 | #创建外键约束 易错题#
alter table audit add constraint foreign key (emp_no) references employees_test(id) 创建外键语句结构:ALTER TABLE <表名>ADD CONSTRAINT FOREIGN KEY (<列名&...
2024-07-22
1
169
题解 | #表名修改 易错题#
alter table titles_test rename titles_2017 https://blog.nowcoder.net/n/5c8373a55385493c87db5c1e73a52958
2024-07-22
1
148
题解 | #替换 易错题#
replace into titles_test values('5', '10005', 'Senior Engineer', '1986-06-26', '9999-01-01')
2024-07-22
1
144
题解 | #更新为NULL 易错题#
update titles_test set to_date=null, from_date='2001-01-01' where to_date='9999-01-01'
2024-07-22
1
176
首页
上一页
1
2
3
4
5
6
7
8
9
10
下一页
末页