数据库-多表查询-连接查询
同时查询多张表获取到需要的数据 比如:我们想查询到开发部有多少人,需要将部门表和员工表同时进行查询
多表查询的分类:
准备数据
-- 创建部门表
create table...,gender,salary,join_date,dept_id) values('唐僧','男',9000,'2008-08-08',2);
insert into emp(name,gender,salary...,join_date,dept_id) values('白骨精','女',5000,'2015-10-07',3);
insert into emp(name,gender,salary,join_date...2011-03-14 | 1 |
| 6 | 沙僧 | 男 | 6666 | 2013-02-24 | NULL | -- 可以看到该条数据没有 dept_id 的值...SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use