Gary96
Gary96
全部文章
题解
归档
标签
去牛客网
登录
/
注册
Gary96的博客
全部文章
/ 题解
(共19篇)
题解 | #创建一个actor_name表#
create table if not exists actor_name ( first_name varchar(45) not null, last_name varchar(45) not null ) select first_name,last_name from actor crea...
Mysql
2022-01-15
0
253
题解 | #对first_name创建唯一索引uniq_idx_firstname#
CREATE INDEX idx_lastname ON actor(last_name); CREATE UNIQUE INDEX uniq_idx_firstname ON actor(first_name);
Mysql
2022-01-15
0
316
题解 | #构造一个触发器audit_log#
create trigger audit_log after insert on employees_test for each row BEGIN insert&nbs...
Mysql
2022-01-15
0
352
题解 | #查找入职员工时间排名倒数第三的员工所有信息#
窗口函数 select emp_no, birth_date, first_name, last_name, gender, hire_date from( select *,&nb...
Mysql
2022-01-13
1
386
题解 | #查找字符串中逗号出现的次数#
将逗号替换为空,计算str长度差 select id, LENGTH(string) - LENGTH(replace(string, ',','')) cnt from strings;
Mysql
2022-01-13
0
282
题解 | #获取employees中的first_name#
LEFT(s,n)返回字符串 s 的前 n 个字符 RIGHT(s,n)返回字符串 s 的后 n 个字符 right select first_name from employees order by right(first_name, 2) substr / substring select f...
Mysql
2022-01-12
0
305
题解 | #按照dept_no进行汇总#
聚合函数group_concat(X,Y),其中X是要连接的字段,Y是连接时用的符号,可省略,默认为逗号。 此函数必须与GROUP BY配合使用 SELECT dept_no, group_concat(emp_no) employees FROM dept_emp GROUP BY dept_...
Mysql
2022-01-12
0
296
题解 | #刷题通过的题目排名#
窗口函数 1 1 1 ...
Mysql
2022-01-12
0
257
题解 | #考试分数(二)#gary
方法1 窗口函数 SELECT id, job, score FROM grade a WHERE score> ( SELECT AVG(score) FROM grade b WHERE a.job = b.job) ORDER BY a.id select id, job, sc...
Mysql
2022-01-11
0
360
首页
上一页
1
2
下一页
末页