Sort by

recency

|

3321 Discussions

|

  • + 0 comments

    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 or b = c or a = c THEN "Isosceles" ELSE "Scalene" END from Triangles;

  • + 0 comments

    Can anyone help me understand why this is not an acceptable solution?

    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 OR B=C OR C=A THEN 'Isosceles' ELSE 'Scalene' END FROM TRIANGLES

  • + 0 comments

    SELECT CASE WHEN A + B > C AND A + C > B AND B + C > A THEN -- Check for valid triangle CASE WHEN A = B AND B = C THEN 'Equilateral' WHEN (A = B and B != C) or (A != B and B = C) THEN 'Isosceles' WHEN A != B AND B != C THEN 'Scalene' END ELSE 'Not A Triangle' -- If the sides don't form a valid triangle END AS TriangleType FROM Triangles;

  • + 1 comment
    SELECT CASE
                WHEN A + B <= C OR A + C <= B OR B + C <= A THEN "Not A Triangle"
                WHEN A = B AND B = C THEN "Equilateral"
                WHEN A = B OR A = C OR B = C THEN "Isosceles"
                ELSE "Scalene"
            END
    FROM TRIANGLES
    
  • + 0 comments

    SELECT CASE WHEN (A + B > C AND A + C > B AND B + C > A) THEN CASE WHEN (A=B AND B=C AND C=A) THEN 'Equilateral' WHEN (A=B OR B=C OR C=A) THEN 'Isosceles' ELSE 'Scalene' END ELSE 'Not A Triangle' END FROM TRIANGLES ;