All efficient solutions to HackerRank problems
Type of Triangle
Problem Statement: Type of Triangle
SELECT CASE WHEN (a=b) AND (a=c) THEN "Equilateral" WHEN (2*GREATEST(a,b,c)) >= (a+b+c) THEN "Not A Triangle" WHEN (a=b) OR (a=c) OR (b=c) THEN "Isosceles" ELSE "Scalene" END FROM triangles;
Explanation: Finding the (Equilateral or Isosceles or Scalene or Not a Triangle) from the table triangles based on the column points.