전체 글(72)
-
[SQL] Hackerrank - Placements
Problem You are given three tables: Students, Friends and Packages. Students contains two columns: ID and Name. Friends contains two columns: ID and Friend_ID (ID of the ONLY best friend). Packages contains two columns: ID and Salary (offered salary in $ thousands per month). Write a query to output the names of those students whose best friends got offered a higher salary than them. Names must ..
2023.04.05 -
[SQL] HackerRank - Project Planning
Problem You are given a table, Projects, containing three columns: Task_ID, Start_Date and End_Date. It is guaranteed that the difference between the End_Date and the Start_Date is equal to 1 day for each row in the table. If the End_Date of the tasks are consecutive, then they are part of the same project. Samantha is interested in finding the total number of different projects completed. Write..
2023.04.05 -
[SQL] Hackerrank - Binary Tree Nodes
자존감 회복을 위해서 간단한 문제를 풀어보았다. Problem Binary Tree Node를 Node 칼럼과 Parent 칼럼으로 저장하는데 각각의 칼럼은 자신의 값과 부모노드의 값을 가지고 있다고 가정한 문제임 여기서 Sample Input 으로 임의의 Nodes 들을 입력했을때, 해당 노드의 Type과 value를 출력하라는 문제였음 Condition 노드의 타입은 3가지 Root: If node is root node. Leaf: If node is leaf node. Inner: If node is neither root nor leaf node. Solution Select Case문으로 간단하게 처리가 가능할것 같았다. 먼저 해당 노드의 칼럼인 n과 p를 통해서 노드들의 타입을 판별하는 코드..
2023.04.02 -
[SQL] Hackerrank - Olivander's Inventory
https://www.hackerrank.com/challenges/harry-potter-and-wands Problem 더보기 Harry Potter and his friends are at Ollivander's with Ron, finally replacing Charlie's old broken wand. Hermione decides the best way to choose is by determining the minimum number of gold galleons needed to buy each non-evil wand of high power and age. Write a query to print the id, age, coins_needed, and power of the wand..
2023.03.31 -
[SQL] HACKERRANK - TOP COMPETITORS
https://www.hackerrank.com/challenges PROBLEM Julia just finished conducting a coding contest, and she needs your help assembling the leaderboard! Write a query to print the respective hacker_id and name of hackers who achieved full scores for more than one challenge. Order your output in descending order by the total number of challenges in which the hacker earned a full score. If more than one..
2023.03.31 -
[SQL] HAKERRANK - THE REPORT
https://www.hackerrank.com/challenges/the-report/ The Report | HackerRank Write a query to generate a report containing three columns: Name, Grade and Mark. www.hackerrank.com PROBLEM Ketty gives Eve a task to generate a report containing three columns: Name, Grade and Mark. Ketty doesn't want the NAMES of those students who received a grade lower than 8. The report must be in descending order b..
2023.03.31