triangle-judgement.sql (346B)
1 --Find if the lengths of sides can make a triangle and add attribute that states yes or no if it can 2 --Name that attribute triangle 3 --Runtime: 538ms Beats: 35.62% 4 SELECT t.x, t.y, t.z, 5 CASE 6 WHEN x + y > z AND y+x > z AND z+y > x AND z+x > y THEN "Yes" 7 WHEN y >= x+z OR z >= x+y OR x >= y+z THEN "No" 8 END AS triangle 9 FROM Triangle AS t