Algorithm/SQL4 [SQL] HackerRank - 핵심 문제만 풀어보기 - (2) ◈ HackerRank의 일부 문제(Easy 제외)와 해설을 복원한 글 ◈ 오류 정정 및 피드백 환영 Contest Leaderboard [문제] Write a query to print the hacker_id, name, and total score of the hackers ordered by the descending score. The total score of a hacker is the sum of their maximum scores for all of the challenges. If more than one hacker achieved the same total score, then sort the result by ascending hacker_id. Exclude all hacker.. 2022. 2. 17. [SQL] HackerRank - 핵심 문제만 풀어보기 - (1) ◈ HackerRank의 일부 문제(Easy 제외)와 해설을 복원한 글 ◈ 오류 정정 및 피드백 환영 The PADs [문제] 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 occurrences of each occupation in OCCUPATIONS.. 2022. 2. 16. [SQL] LeetCode - 핵심 문제만 풀어보기 ◈ LeetCode의 일부 문제(무료)와 해설을 복원한 글 ◈ 오류 정정 및 피드백 환영 ◈ 쿼리 연습을 위해 수정한 문제가 있음 Employees Earning More Than Their Managers - WHERE / AND [문제] Write a SQL query that finds out employees who earn more than their managers. The headers of the output should be 'Employee'. [풀이] 굳이 join을 할 필요는 없다. SELECT e1.Name AS Employee FROM Employee AS e1, Employee AS e2 WHERE e1.ManagerId = e2.Id AND e1.Salary > e2.Sala.. 2022. 2. 14. [SQL] 프로그래머스 - 핵심 문제만 풀어보기 ◈ 프로그래머스의 일부 문제와 해설을 복원한 글 ◈ 오류 정정 및 피드백 환영 IFNULL / LIMIT NULL 처리하기 [문제] 동물의 생물 종, 이름, 성별 및 중성화 여부를 조회하시오. - 이름이 없는 동물의 이름은 No name으로 표시 - 5개만 조회 - ID 순으로 조회 [풀이] SELECT ANIMAL_TYPE, IFNULL(NAME, 'No name'), SEX_UPON_INTAKE FROM ANIMAL_INS ORDER BY ANIMAL_ID LIMIT 5 ; IF / LIKE / REGEXP 중성화 여부 파악하기 [문제] 동물의 아이디와 이름, 중성화 여부를 조회하시오. - 중성화된 동물은 SEX_UPON_INTAKE 컬럼에서 'Neutered' 또는 'Spayed'라는 단어 포함 -.. 2022. 2. 13. 이전 1 다음