select emp.name,emp.gender,dept.dname from emp,dept where emp.dep_id=dept.did;
select t1.name,t1.gender,t2.dname from emp t1,dept t2 where t1.dep_id=t2.did; -- 为了防止表名过长,还可以给表取别名
select * from emp INNER JOIN dept on emp.dep_id=dept.did;
1. select * from emp left OUTER join dept on emp.dep_id=dept.did;
2. select * from emp right OUTER join dept on emp.dep_id=dept.did;