Writing Conditions in Left join sql I want to know why these queries give different results

    Select *  FROM Table1 T1 
    Left Join MyTable MT 
    ON MT.studentId = T1.StudentId 
    AND T1.class = 7



    Select *  FROM Table1 T1 
    Left Join MyTable MT 
    ON MT.studentId = T1.StudentId 
    WHERE T1.class = 7
The where clause is evaluated after the join. A left join B means all tuples  from A together with the matching tuples from B, if no tuples from B match null is the result. Given:

create table t1 (studentid int not null, class int not null);
create table t2 (studentid int not null);
insert into t1 values (1,1),(2,2);
insert into t2 values (1);

select * from t1 left join t2 on t1.studentid = t2.studentid;

STUDENTID   CLASS       STUDENTID  
----------- ----------- -----------
      1           1           1
      2           2           -


i.e. there is no row in t2 that matches studentid 1 so a null is the result. For:

select * from t1 
left join t2 
    on t1.studentid = t2.studentid 
   and t1.class = 1;


Nothing changes. For:

select * from t1 
left join t2 
    on t1.studentid = t2.studentid 
where t1.class = 1;


on the other hand, the where clause is evaluated after the join so t1.studentid  2 is removed from the result.