• Skip to primary navigation
  • Skip to content
  • Skip to footer
Thomas Ngo's Developer Journal Thomas Ngo's Developer Journal
  • Home
  • Journal
  • Tags
  • About
    Thomas Ngo

    Thomas Ngo

    Software Engineer

    • Stanton, California
    • Email
    • GitHub
    • Resume

    SQL problem - Triangle Judgement

    February 24, 2024 less than 1 minute read

    Page Navigation

    • Problem
    • Query
    • Editorial Solution

    Problem

    problem-610

    Query

    SELECT 
        *, 
        IF(x + y > z AND x + z > y AND y + z > x, 'Yes', 'No') AS triangle
    FROM Triangle
    

    Editorial Solution

    SELECT 
        x,
        y,
        z,
        CASE
            WHEN x + y > z AND x + z > y AND y + z > x THEN 'Yes'
            ELSE 'No'
        END AS 'triangle'
    FROM
        triangle
    ;
    

    Tags: SQL

    Updated: February 24, 2024

    Share on

    Twitter Facebook LinkedIn
    Previous Next

    You may also enjoy

    Problem of The Day: Find Minimum Time to Reach Last Room II

    May 7, 2025 1 minute read

    Problem Statement

    Problem of The Day: Number of Equivalent Domino Pairs

    May 4, 2025 1 minute read

    Problem Statement

    Problem of The Day: Minimum Domino Rotations For Equal Row

    May 3, 2025 2 minute read

    Problem Statement

    Problem of The Day: Push Dominoes

    May 2, 2025 2 minute read

    Problem Statement

    • Follow:
    • GitHub
    • LinkedIn
    © 2025 Thomas Ngo.