목록SQL/HackerRank (3)
오랑우탄의 반란
오늘도 오랑이는 문제를 풉니다. Symmetric PairsYou are given a table, Functions, containing two columns: X and Y.Two pairs (X1, Y1) and (X2, Y2) are said to be symmetric pairs if X1 = Y2 and X2 = Y1.Write a query to output all such symmetric pairs in ascending order by the value of X. List the rows such that X1 ≤ Y1. Sample InputSample Output20 2020 2122 23 풀이과정x1 = y2 & x2 = y1 인 행이 2개 이상인 경우x 첫번째 풀이는 셀프조인..
오늘도 오랑이는 문제를 풉니다. SQL Project PlanningYou 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 dif..
오랜만에 오랑이는 문제를 풉니다. Weather Observation Station 20A 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 Format The STATION table is described as follows where LAT_N is the northern latitude and LONG_W is the western longitude. 중앙값을 구하는 문제입니다.O..