SQL 스터디/HackerRank 16

[해커랭크] MySQL PERCENT_RANK - Weather Observation Station 20

Weather Observation Station 20 | HackerRank Query the median of Northern Latitudes in STATION and round to 4 decimal places. www.hackerrank.com LAT_N 값 중에서 중앙값(Median)을 찾는 문제입니다. 문제) A median is defined as a number separating the higher half of a data set from the lower half. Query the median of the Northern Latitudes (LAT_N) from STATION and round your answer to 4 decimal places. 이번 문제는 WINDOW ..

[해커랭크] MySQL JOIN - New Companies

New Companies | HackerRank Find total number of employees. www.hackerrank.com 이번 문제는 JOIN과 계산함수를 활용하는 문제입니다. Amber's conglomerate corporation just acquired some new companies. Each of the companies follows this hierarchy: Given the table schemas below, write a query to print the company_code, founder name, total number of lead managers, total number of senior managers, total number of managers, ..

[해커랭크] MySQL - Binary Tree Nodes

Binary Tree Nodes | HackerRank Write a query to find the node type of BST ordered by the value of the node. www.hackerrank.com 이번 문제는 이진 트리와 관련된 문제를 푸는 쿼리입니다. 문제) You are given a table, BST, containing two columns: N and P, where N represents the value of a node in Binary Tree, and P is the parent of N. Write a query to find the node type of Binary Tree ordered by the value of the node. Output o..

[해커랭크] MySQL TRNCATE 함수 - Weather Observation Station 14

Weather Observation Station 14 | HackerRank Query the greatest value of the Northern Latitudes from STATION that are under 137.2345 and truncated to 4 decimal places. www.hackerrank.com 137.2345 보다 낮은 북위도 중 가장 큰 값을 찾는 쿼리를 출력하는 문제입니다. 문제) Query the greatest value of the Northern Latitudes (LAT_N) from STATION that is less than 137.2345. Truncate your answer to decimal places. 그리고 소수점을 4자리 밑으로는 제외..

[해커랭크] MySQL 숫자를 문자로 변환하기(CAST) - The Blunder

The Blunder | HackerRank Query the amount of error in Sam's result, rounded up to the next integer. www.hackerrank.com 점점 문제가 길어지고 영어 공부도 같이 하는 것 같습니다 :) 이번 문제는 Samatha라는 직원이 전 직원의 평균 급여를 계산하고 있는데 숫자 '0'키가 고장났다는 상황을 가정하여 실제 평균급여와 '0'을 누르지 못했을 때의 평균급여 금액의 차이를 구하는 문제입니다. 문제) Samantha was tasked with calculating the average monthly salaries for all employees in the EMPLOYEES table, but did not real..

[해커랭크] MySQL concat 구문 - The PADS

The PADS | HackerRank Query the name and abbreviated occupation for each person in OCCUPATIONS. www.hackerrank.com 해커랭크에서 처음 만나는 Medium 난이도의 문제였습니다. 크게 어려운 부분은 없긴했지만 union을 사용하다가 오래 걸렸네요..(사실 union을 사용할 필요는 없었습니다) 이번 해커랭크 문제는 2개의 문제가 주어졌습니다. 문제) Generate the following two result sets: 1. Query an alphabetically ordered list of all names in OCCUPATIONS, immediately followed by the first letter of..

[해커랭크] MySQL CASE 구문 - Type of Triangle

Type of Triangle | HackerRank Query a triangle's type based on its side lengths. www.hackerrank.com 이번 문제는 삼각형의 유형을 출력하는 문제입니다. 문제) 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 3 sides of equal length. Isosceles: It's a triangle with 2 s..

[해커랭크] MySQL 정규표현식 - Weather Observation Station 12

Weather Observation Station 12 | HackerRank Query an alphabetically ordered list of CITY names not starting and ending with vowels. www.hackerrank.com 이번 문제는 모음으로 시작하지 않고 모음으로 끝나지 않는 도시이름을 출력하는 문제입니다. [Weather Observation Station 11] 문제와 다르게 이번엔 or 조건이 아닌 and 조건입니다. 문제) Query the list of CITY names from STATION that do not start with vowels and do not end with vowels. Your result cannot contain ..