Classifying Bracing Frames
Problem
A workshop builds triangular bracing frames from three steel struts. Table `Braces` stores one frame per row with the three strut lengths `side_x`, `side_y`, and `side_z` (centimeters). Three lengths only form a real triangle when every side is shorter than the sum of the other two; if any side is greater than or equal to that sum, the struts cannot close into a triangle. For each frame report a single column `frame_kind`:
- `Open Frame` if the three struts cannot form a triangle.
- `Regular` if all three struts are equal.
- `Balanced` if exactly two struts are equal.
- `Irregular` if all three struts differ.
Return one row per frame in any order.
Tables
Example rows — the live problem includes the full dataset.
| side_x | side_y | side_z |
|---|---|---|
| 15 | 15 | 18 |
| 15 | 15 | 15 |
| 15 | 16 | 17 |
Expected output
Your answer should return 4 rows with the columns frame_kind.
Starter code (SQL)
SELECT *
FROM Braces;Solve this SQL question free
Write SQL and run it instantly in your browser — even on your phone. No signup needed to try.
Solution & explanation
Create a free account to unlock the optimal solution, a step-by-step explanation, and the hidden test cases that grade your answer.
Sign up free to unlock