Problem statement:
Write a query identifying the type of each record in the TRIANGLES table using its three side lengths. Output one of the followin
/* THE BELOW CODE WILL CHECK ALL THE POSSIBLE CASES OF A TRIANGLE, THIS CODE WILL WORK 100% */
select case
when A+B<=C OR A+C<=B OR C+B<=A THEN "Not A Triangle"
when (A<>B AND A+B>C) AND (B<>C AND B+C>A) AND (A<>C AND A+C>B) THEN
"Scalene"
when (A=B AND B<>C AND A+B>C) OR (B=C AND B<>A AND B+C>A) OR (A=C AND C<>B
AND A+C>B) THEN "Isosceles"
when A=B AND B=C THEN "Equilateral"
end as triangle
from TRIANGLES;