본문 바로가기

SQL15

[SQL] 해커랭크 HackerRank Occupations 문제 풀이 문제Pivot the Occupation column in OCCUPATIONS so that each Name is sorted alphabetically and displayed underneath its corresponding Occupation. The output should consist of four columns (Doctor, Professor, Singer, and Actor) in that specific order, with their respective names listed alphabetically under each column.Note: Print NULL when there are no more names corresponding to an occupation. 해석 O.. 2025. 3. 13.
[SQL] 해커랭크 HackerRank The PADS 문제 풀이 문제Generate the following two result sets:Query an alphabetically ordered list of all names in OCCUPATIONS, immediately followed by the first letter of each profession as a parenthetical (i.e.: enclosed in parentheses). For example: AnActorName(A), ADoctorName(D), AProfessorName(P), and ASingerName(S).Query the number of ocurrences of each occupation in OCCUPATIONS. Sort the occurrences in ascend.. 2025. 3. 12.
[SQL] 해커랭크 HackerRank 문제 풀이 Type of Triangle - Advanced Select 문제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 f.. 2025. 3. 11.
[SQL] 해커랭크 HackerRank 문제 풀이 Employee Salaries 문제 Employee SalariesWrite a query that prints a list of employee names (i.e.: the name attribute) for employees in Employee having a salary greater than $2000 per month who have been employees for less than 10 months. Sort your result by ascending employee_id. where employee_id is an employee's ID number, name is their name, months is the total number of months they've been working for the compa.. 2025. 3. 10.
[SQL] 해커랭크 HackerRank 문제 풀이 Employee Names 정답 문제Write a query that prints a list of employee names (i.e.: the name attribute) from the Employee table in alphabetical order. employee 테이블에서  이름(name)을 알피벳 순으로 출력하라 정답select namefrom employeeorder by name; 배운 점기본적으로 order by 는 asc 오름차순이다 따라서 디폴트가 asc니까 굳이 안 적어도 된다. 2025. 3. 9.
[SQL] 해커랭크 HackerRank 문제 풀이 Higher Than 75 Marks [SQL] hakerrank 문제 풀이문제Query the Name of any student in STUDENTS who scored higher than  Marks. Order your output by the last three characters of each name. If two or more students both have names ending in the same last three characters (i.e.: Bobby, Robby, etc.), secondary sort them by ascending ID. 한국어 버전STUDENTS 테이블에서 75점보다 점수가 높은 학생의 Name 출력하라.각 이름의 마지막 3개 문자로 정렬하라.만약 마지막 3개 문자 이름이 같다면 ID를 .. 2025. 3. 8.