select case
when (A+B<=C or B+C<=A or A+C<=B) then 'Not A Triangle'
when (A=B and B=c) then 'Equilateral'
when (A=B AND C<>B)or(B=C AND C<>A)or(A=C AND A<>B) then 'Isosceles'
else 'Scalene'
end as triangle_type
from TRIANGLES;
here, it will strictly check for the type of the triangles.