students与classes表,两个表的连接字段是students.cls_id=classes.ID
(1) 左连接:left join on
左边表全取,右边表取共有的,没有的为null
select * from students as s left join classes as c on c.ID=s.cls_id
(2) 右连接:right join on
右边表全取,左边表取共有的,没有的为null
select * from students as s right join classes as c on c.ID=s.cls_id;
(3) 内连接:inner join on
两个表取共有的
select * from students inner join classes on students.cls_id=class.ID;