1.内连接
select s.id,s.name,s.class_id,c.name classes_name,s.gender,s.score
from students s
inner join classes c
on s.class_id = c.id;
2.左外连接
select s.id,s.name,s.class_id,c.name classes_name,s.gender,s.score
from students s
left outer join classes c
on s.class_id = c.id;
3.右外连接
select s.id,s.name,s.class_id,c.name classes_name,s.gender,s.score
from students s
right outer join classes c
on s.class_id = c.id;
4.全外连接
select s.id,s.name,s.class_id,c.name classes_name,s.gender,s.score
from students s
full outer join classes c
on s.class_id = c.id;