双表内部连接查询
select wName,dName from DepartMent,Worker where DepartMent.dID=Worker.did
select wName,dName from DepartMent inner join Worker on DepartMent.dID=Worker.did
多表内部连接查询
select wName,dName,GName from DepartMent,Worker,Gender
where DepartMent.dID=Worker.did and Worker.Gid = Gender.Gid
select wName,dName,GName from DepartMent
inner join Worker on DepartMent.dID=Worker.did
inner join Gender on Worker.Gid=Gender.Gid
外部连接查询
--1.左外连接查询
select wName,dName from DepartMent
left outer join Worker on DepartMent.dID=Worker.did
--2.右外连接查询
select wName,dName from DepartMent
right outer join Worker on DepartMent.dID=Worker.did
--3.完全外部连接查询
select wName,dName from DepartMent
full outer join Worker on DepartMent.dID=Worker.did
--4.交叉连接
select wName,dName from DepartMent
Cross join Worker
select wName,dName from DepartMent, Worker