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
- 코딩테스트
- 피그마인디언
- MS SQL Server
- leetcode
- ProfileReport
- ModelCheckPoint
- kaggle
- 신경쓰기의 기술
- Product Demand
- SKU Consolidation
- pandas profiling
- 웨어하우스 보관 최적화
- TensorFlowGPU
- 딥러닝
- MySQL
- eda
- forecast
- Gaimification
- HackerRank
- 코딩테스트연습
- Inventory Optimization
- SQL
- 데이터분석
- 당신의 인생이 왜 힘들지 않아야 한다고 생각하십니까
- Labor Management System
- tensorflow
- ABC Analysis
- oracle
- 파이썬
- 프로그래머스
Archives
- Today
- Total
오늘도 배운다
Type of Triangle / HackerRank, SQL, MySQL 본문
문제
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.
제출답안(MySQL)
SELECT
CASE WHEN (a+b<=c OR a+c<= b OR b+c<= a) THEN 'Not A Triangle'
WHEN (a=b AND a=c) THEN 'Equilateral'
WHEN (a!=b AND b!=c AND c!=a) THEN 'Scalene'
ELSE 'Isosceles' END
FROM triangles
문제 바로가기(MySQL)
728x90
'코딩테스트연습(SQL)' 카테고리의 다른 글
The Blunder / HackerRank, SQL, MySQL (0) | 2022.12.14 |
---|---|
The PADS / HackerRank, SQL, MySQL (0) | 2022.12.05 |
Higher Than 75 Marks / HackerRank, SQL, MySQL (0) | 2022.12.01 |
Weather Observation Station 12 / HackerRank, SQL, MySQL (0) | 2022.12.01 |
Weather Observation Station 11 / HackerRank, SQL, MySQL (0) | 2022.12.01 |
Comments