Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | |||
5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 | 13 | 14 | 15 | 16 | 17 | 18 |
19 | 20 | 21 | 22 | 23 | 24 | 25 |
26 | 27 | 28 | 29 | 30 | 31 |
Tags
- Git
- coding
- sql
- 클라우드컴퓨팅
- hackerrank
- HTML
- merge
- leetcode
- RLIKE
- programmers
- branch
- full request
- github
- elastic net
- 교차 엔트로피
- 버전충돌
- early stopping
- AWS
- CSS
- window function
- L1정규화
- PYTHON
- conflict
- 코딩공부
- L2정규화
- mysql
- 편향-분산 교환
- 온라인협업
- 선형 모형
- 깃헙협업
Archives
- Today
- Total
Im between cherry
Hackerrank | MySQL | Type of Triangle 본문
Type of Triangle
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.
SELECT CASE
WHEN A + B > C AND A + C > B AND B + C > A THEN CASE
WHEN A = B AND B = C THEN 'Equilateral'
WHEN A = B OR A = C OR B = C THEN 'Isosceles'
ELSE 'Scalene'
END
ELSE 'Not A Triangle'
END
FROM TRIANGLES
'데이터분석 > practice_query' 카테고리의 다른 글
Hackerrank | MySQL | The Report (0) | 2020.08.30 |
---|---|
Hackerrank | MySQL | Challenges (0) | 2020.08.29 |
Hackerrank | MySQL | Symmetric Pairs (0) | 2020.08.29 |
Hackerrank | MySQL | Draw The Triangle 2 (0) | 2020.08.29 |
Hackerrank | MySQL | Draw The Triangle 1 (0) | 2020.08.29 |
Comments