Uber relies on geometric algorithms for mapping and routing. A fundamental check is determining if three line segments can form a triangle. According to the triangle inequality theorem, for any three sides, the sum of any two sides must be strictly greater than the third side.
Write an SQL query to report for every three line segments whether they can form a triangle.
| x(INTEGER) | y(INTEGER) | z(INTEGER) |
|---|---|---|
| 13 | 15 | 30 |
| 10 | 10 | 10 |
| x(INTEGER) | y(INTEGER) | z(INTEGER) | triangle(VARCHAR) |
|---|---|---|---|
| 10 | 10 | 10 | Yes |
| 13 | 15 | 30 | No |