fejxc
fejxc
全部文章
题解
归档
标签
去牛客网
登录
/
注册
fejxc的博客
全部文章
/ 题解
(共47篇)
题解 | #对first_name创建唯一索引uniq_idx_firstname#
MYSQL创建索引的两种方法 create [unique]index 索引名 on 表名(列名); alter table 表名 add [unique]index 索引名(列名);alter table actor add unique index uniq_idx_firstname(fir...
Mysql
2021-09-23
0
276
题解 | #创建一个actor_name表#
创建表的3中方法:1.create table xxx2.create xxx(目标表) like xxx(数据源表)3.create talbe xxx (.....)insert into xxx(目标表) select ... from xxx(数据源表)我用的是第三种方法 CREATE T...
Mysql
2021-09-23
0
267
题解 | #批量插入数据,不使用replace操作#
insert into (会见检查主键是否存在)replace into (要求表要有主键或者唯一索引)insert ignore into (忽视主键重复) insert ignore into actor values('3','ED','CHASE','2006-02-15 12:34:33'...
Mysql
2021-09-23
0
296
题解 | #批量插入数据#
insert into actor(actor_id,first_name,last_name,last_update) values(1,'PENELOPE','GUINESS','2006-02-15 12:34:33'), (2,'NICK','WAHLBERG','2006-02-15 12...
Mysql
2021-09-23
0
286
题解 | #创建一个actor表,包含如下列信息#
create table if not exists `actor`( actor_id smallint(5) primary key COMMENT '主键id', first_name varchar(45) not null COMMENT '名字', last_na...
Mysql
2021-09-23
0
341
题解 | #使用子查询的方式找出属于Action分类的所有电影对应的title,description#
子查询,可以用in或者exists select f.title,f.description from film f where f.film_id in(select fc.film_id from category c,film_category fc where fc.category_id...
Mysql
2021-09-23
0
320
题解 | #使用join查询方式找出没有分类的电影id以及名称#
select f.film_id , f.title from film f left join film_category fc on f.film_id=fc.film_id where fc.category_id is NULL
Mysql
2021-09-21
0
275
题解 | #查找描述信息中包含robot的电影对应的分类名称以及电影数目,而且还需要该分类对应电影数量>=5部#
应该先找到每个电影分类下电影总数量大于5的category_id select c.name, count(fc.film_id) from film f,category c,film_category fc where f.description like '%robot%' an...
Mysql
2021-09-20
0
287
题解 | #汇总各个部门当前员工的title类型的分配数目#
select d.dept_no,d.dept_name,t.title,count(t.title) from dept_emp de INNER join departments d on de.dept_no=d.dept_no and de.to_date='9999-01-01' inne...
Mysql
2021-09-20
0
263
题解 | #汇总各个部门当前员工的title类型的分配数目#
select d.dept_no,d.dept_name,t.title,count(*) from dept_emp de INNER join departments d on de.dept_no=d.dept_no and de.to_date='9999-01-01' inner join...
Mysql
2021-09-20
0
333
首页
上一页
1
2
3
4
5
下一页
末页