MSSQL Server 2012 Query Do we Need T-SQL for query with IF Condition?
You're talking about a CASE expression:

DECLARE @Table table (StudentId INT, GradeExam1 int, GradeExam2 int);
insert into @Table (StudentId,GradeExam1,GradeExam2) values (1,95,88);
insert into @Table (StudentId,GradeExam1,GradeExam2) values (2,85,93);
insert into @Table (StudentId,GradeExam1,GradeExam2) values (3,75,87);

SELECT StudentId
    ,CASE 
        WHEN GradeExam1 &gt;= 90
            AND GradeExam1 &lt;= 100
            THEN 'A'
        WHEN GradeExam1 &gt;= 80
            AND GradeExam1 &lt;= 90
            THEN 'B'
        WHEN GradeExam1 &gt;= 70
            AND GradeExam1 &lt;= 80
            THEN 'C'
        END AS GradeExam1
    ,CASE 
        WHEN GradeExam2 &gt;= 90
            AND GradeExam2 &lt;= 100
            THEN 'A'
        WHEN GradeExam2 &gt;= 80
            AND GradeExam2 &lt;= 90
            THEN 'B'
        WHEN GradeExam2 &gt;= 70
            AND GradeExam2 &lt;= 80
            THEN 'C'
        END AS GradeExam2
FROM @table;


My example of a CASE expression is Standard SQL and not specific to just the T-SQL syntax.

Check here, if you'd like to learn more about the implementation of the CASE expression.