左连接,结果大于左面的表验证 解释

create table Employees (
       last_name varchar2(10),
       department_id varchar2(10)
);
create table Department(
       department_id varchar2(10),
       department_name varchar2(10)
);
insert into Employees values ('tom','1');
insert into Employees values ('peter','2');
insert into Employees values ('alice','3');
insert into Employees values ('jenny','5');
insert into Employees values ('linda','7');
commit;

insert into Department values ('1','baidu');
insert into Department values ('2','tensun');
insert into Department values ('3','BTC');
insert into Department values ('4','EOS');
insert into Department values ('5','HSR');
insert into Department values ('6','OMG');
insert into Department values ('7','ETH');
commit;
select * from Employees;
select * from Department  ;

/*
左连接验证(左边一共5条数据,查出来大于左边的5条,怎么解释,)
*/

select e.last_name, e.department_id, d.department_name
  from Employees e
  left outer join Department d on e.department_id = d.department_id;

LAST_NAME DEPARTMENT_ID    
1 tom 1
2 peter 2
3 alice 3
4 jenny 5
5 linda 7

 

DEPARTMENT_ID DEPARTMENT_NAME
1 1 baidu
2 2 tensun
3 3 BTC
4 4 EOS
5 5 HSR
6 6 OMG
7 1 woniupp

 

 

LAST_NAME DEPARTMENT_ID DEPARTMENT_NAME
1 1 baidu
2 peter 2 tensun
3 alice 3 BTC
4 jenny 5 HSR
5 tom 1 woniupp
6 linda 7

 

 

 

 

 

posted @ 2018-02-05 10:48  酸奶加绿茶  阅读(215)  评论(0编辑  收藏  举报