Created
March 30, 2022 17:36
-
-
Save IndigoW0lf/883ea9b7213e8229e358268362dc0cf5 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT | |
CASE | |
WHEN A + B <= C or A + C <= B or B + C <= A THEN 'Not A Triangle' | |
WHEN A = B and B = C THEN 'Equilateral' | |
WHEN A = B or A = C or B = C THEN 'Isosceles' | |
WHEN A != B and B != C THEN 'Scalene' | |
END tuple | |
FROM TRIANGLES; | |
Write a query identifying the type of each record in the TRIANGLES table using | |
its three side lengths. Output one of the following statements for each record in the table: | |
Equilateral: It's a triangle with sides of equal length. | |
Isosceles: It's a triangle with sides of equal length. | |
Scalene: It's a triangle with sides of differing lengths. | |
Not A Triangle: The given values of A, B, and C don't form a triangle. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment