[HackerRank SQL] Type of Triangle

문제 link
https://www.hackerrank.com/challenges/what-type-of-triangle/problem

Code link
https://github.com/JamesJung01/Hackerrank_sql/blob/main/01_Easy/Type_of_Triangle.sql

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

좋은 웹페이지 즐겨찾기