1、内连接 inner join  

JOIN 相当于INNER JOIN内连接,不满足on 的条件过滤掉,不显示

eg:   select * from student s inner join class c on s.class_id = c.id

 

2、左连接  left join

以左边数据为主,不满足 on 的条件留在左边,右边数据为null

eg:  select * from student s left join class c on s.class_id = c.id

 

3、右连接  right join

以右边数据为主,不满足on 的条件留在右边,左边数据为null

eg: select * from student s right join class c on s.class_id = c.id