• Skip to primary navigation
  • Skip to content
  • Skip to footer
Thomas Ngo Thomas Ngo Crafting Elegant Solutions Through Code
  • Home
  • Journal
  • Tags
  • About

    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
    1 min read 147 words

    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

    X Facebook LinkedIn Bluesky
    Previous Next

    Leave a comment

    You may also enjoy

    Mastering I/O in C# & .NET 10: A Practical Guide to Files, Directories, and Streams

    March 23, 2026 7 minute read

    Learn how to perform common I/O tasks in .NET 10 with high performance and modern C# syntax. From simple file reading to advanced stream handling.

    Solving Product of Array Except Self in C#

    3 minute read

    Learn how to calculate the product of all elements except the current one in O(N) time and O(1) extra space without using the division operator.

    Understanding the SAGA Pattern in .NET Microservices: A Beginner’s Guide

    March 22, 2026 10 minute read

    In a monolithic application, maintaining data consistency is straightforward. Database operations are typically wrapped in a single transaction, ensuring tha...

    Solving Encode and Decode Strings in C#

    3 minute read

    Learn how to encode and decode a list of strings in C# using both a unique separator and the robust length-prefix approach.

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