sky丶Mamba2
sky丶Mamba2
全部文章
分类
c++(1)
c语言(2)
Java后端(1)
mysql(2)
PAT(1)
PAT (Basic Level)(76)
其它(5)
大学文档(7)
数据分析(6)
社区发现(1)
算法(1)
题解(80)
归档
标签
去牛客网
登录
/
注册
sky丶Mamba2的博客
TA的专栏
80篇文章
0人订阅
sql题
80篇文章
1717人学习
全部文章
(共183篇)
题解 | 72#考试分数(一)#
来自专栏
select job,round(avg(score),3) avg from grade group by job order by score desc思路:使用round函数针对求出的平均分保留3位小数点
2021-08-05
0
288
题解 | 17#获取当前薪水第二多的员工的emp_no以及其对应的薪水salary#
来自专栏
select emp_no,salary from salaries order by salary desc limit 1,1思路:对salary进行降序排序,然后用limit取第二个
2021-08-05
0
397
题解 | 34#批量插入数据#
来自专栏
insert into actor values(1, 'PENELOPE','GUINESS','2006-02-15 12:34:33'), (2,'NICK','WAHLBERG','2006-02-15 12:34:33');思路:知道插入语句代码就会做了
2021-08-05
0
308
题解 | 36#创建一个actor_name表#
来自专栏
create table actor_name (select first_name,last_name from actor)思路:用现有表的数据构建新表
2021-08-05
0
325
题解 | 35#批量插入数据,不使用replace操作#
来自专栏
insert ignore into actor values (3, 'ED', 'CHASE', '2006-02-15 12:34:33')思路:掌握insert ignore 语句的意思就好了
2021-08-04
0
311
题解 | 38#针对actor表创建视图actor_name_view#
来自专栏
create view actor_name_view as select first_name as first_name_v, last_name as last_name_v from actor思路:掌握创建视图的语句就好了
2021-08-04
0
350
题解 | 30#使用子查询的方式找出属于Action分类的所有电影对应的title,description#
来自专栏
select title, description from film where film_id in (select film_id from film_category where category_id in (select category_id from category where ...
2021-08-04
0
386
题解 | 15#查找employees表emp_no与last_name的员工信息#
来自专栏
select * from employees where emp_no%2 = 1 and last_name <> 'Mary' order by hire_date desc思路:对emp_no利用取余进行奇偶判断
2021-08-04
0
333
题解 | 53#按照dept_no进行汇总#
来自专栏
select dept_no, group_concat(emp_no) as employees from dept_emp group by dept_no 思路:了解group_concat()函数就会做了,聚合函数group_concat(X,Y),其中X是要连接的字段,Y是连接时用的符号,...
2021-08-03
0
357
题解 | 62#出现三次以上相同积分的情况#
来自专栏
select number from grade group by number having count(number)>=3思路:使用group by 加 having 实现,注意不能在where里面写聚合函数。
2021-08-03
0
389
首页
上一页
10
11
12
13
14
15
16
17
18
19
下一页
末页