|
EMP |
ID |
Name |
Country |
Salary |
1 |
Vijay |
India |
6000 |
2 |
Bill |
USA |
8000 |
3 |
Kris |
France |
3000 |
|
SELECT *,
CASE
WHEN Salary < 5000 THEN 'No Tax'
WHEN Salary > 5000 THEN 'High Tax'
WHEN Salary = 5000 THEN 'Low Tax'
ELSE 'Invalid Data'
END
AS Tax
FROM EMP
|
Output |
ID |
Name |
Country |
Salary |
Tax |
1 |
Vijay |
India |
6000 |
High Tax |
2 |
Bill |
USA |
8000 |
High Tax |
3 |
Kris |
France |
3000 |
No Tax |
|