SQL | HackerRank Ollivander’s Inventory
·
Computer Science/SQL
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 wands that Ron's interested in, sorted in order of descending power. If more ..
SQL | HackerRank 코딩 대회에서 여러 문제를 만점 받은 참가자 찾기
·
Computer Science/SQL
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 hacker received full scores in same number of..
SQL | HackerRank 성적에 따라 이름을 보여주는 리포트 만들기 CASE WHEN
·
Computer Science/SQL
You are given two tables: Students and Grades. Students contains three columns ID, Name and Marks.Grades contains the following data: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 by grade -- i.e. higher grades are entered first. If..
SQL | HackerRank ROW_NUMBER()와 COUNT(*) OVER()를 활용하여 중앙값(Median) 구하기
·
Computer Science/SQL
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 decimal places. Input FormatThe STATION table is described as follows:SELECT ROUND(AVG(LAT_N), 4)FROM ( SELECT LAT_N, ROW_NUMBER() OVER(ORDER BY LAT_N ASC) AS RN, COUNT(*) OVER() AS Total_Rows FROM STATI..
SQL | HackerRank 평균 오차 구하기 (Replace)
·
Computer Science/SQL
Samantha was tasked with calculating the average monthly salaries for all employees in the EMPLOYEES table, but did not realize her keyboard's key was broken until after completing the calculation. She wants your help finding the difference between her miscalculation (using salaries with any zeros removed), and the actual average salary.Write a query calculating the amount of error (i.e.: avera..
SQL | HackerRank 이진 트리 노드 유형(Root, Inner, Leaf) 구분하는 쿼리
·
Computer Science/SQL
You are given a table, BST, containing two columns: N and P, where Nrepresents 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 one of the following for each node:Root: If node is root node.Leaf: If node is leaf node.Inner: If node is neither root nor leaf node.Sample Input ExplanationThe Bina..
올리브한입
'분류 전체보기' 카테고리의 글 목록 (3 Page)