select * from StudySQL.dbo.id_name n
inner join StudySQL.dbo.id_sex s
on n.id=s.id
and s.sex='f'
select * from StudySQL.dbo.id_name n
inner join StudySQL.dbo.id_sex s
on n.id=s.id
where s.sex='f'
The result are identical. So any difference between them?
Add
I made several more interesting tries.
select * from StudySQL.dbo.id_name n
1 | baby
3 | alice
select * from StudySQL.dbo.id_class c
1 | math
3 | physics
3 | english
4 | chinese
select * from StudySQL.dbo.id_name n
left join StudySQL.dbo.id_class c
on n.name='alice'
name id id class
baby 1 NULL NULL
alice 3 1 math
alice 3 3 physics
alice 3 3 english
alice 3 4 chinese
select * from StudySQL.dbo.id_name n
left join StudySQL.dbo.id_class c
on n.name='baby'
name id id class
baby 1 1 math
baby 1 3 physics
baby 1 3 english
baby 1 4 chinese
alice 3 NULL NULL
select * from StudySQL.dbo.id_name n
left join StudySQL.dbo.id_class c
on n.name<>''
name id id class
baby 1 1 math
baby 1 3 physics
baby 1 3 english
baby 1 4 chinese
alice 3 1 math
alice 3 3 physics
alice 3 3 english
alice 3 4 chinese
So I thinnk it's reasonable to say, the on clause decides which rows should be joined. While the where clause decides which rows should be returned.
If this is true, I think it's better to write detailed restrictions in the on clause so that fewer rows needs to be joined. Becuase the join is an expensive operation.