전체 글93 [LeetCode] UPDATE : 627. Swap Salary 1. 문제 Table: Salary +-------------+----------+ | Column Name | Type | +-------------+----------+ | id | int | | name | varchar | | sex | ENUM | | salary | int | +-------------+----------+ id is the primary key for this table. The sex column is ENUM value of type ('m', 'f'). The table contains information about an employee. Write an SQL query to swap all 'f' and 'm' values (i.e., change all 'f' v.. 2021. 3. 24. [HackerRank] Binary Tree Nodes 1. 문제 You are given a table, BST, containing two columns: N and P, where N represents 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 Sample .. 2021. 3. 23. [HackerRank] Placements 1. 문제 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 be.. 2021. 3. 23. [HackerRank] Weather Observation Station 3 / Weather Observation Station 19 1) Weather Observation Station 3 1. 문제 Query a list of CITY names from STATION for cities that have an even ID number. Print the results in any order, but exclude duplicates from the answer. The STATION table is described as follows: where LAT_N is the northern latitude and LONG_W is the western longitude. 2. 답 SELECT DISTINCT city FROM station WHERE id % 2 = 0 3. KEY POINT 짝수 표현 방법 : 1. n % 2 =.. 2021. 3. 23. [HackerRank] Top Competitors 1. 문제 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 num.. 2021. 3. 23. [HackerRank] Population Density Difference / Weather Observation Station 11 / Weather Observation Station 13 1) Population Density Difference 1. 문제 Query the difference between the maximum and minimum populations inCITY. Input Format The CITY table is described as follows: 2. 답 SELECT MAX(population) - MIN(population) FROM city 3. KEY POINT MAX(컬럼명) : 해당 컬럼에서의 최댓값 MIN(컬럼명) : 해당 컬럼에서의 최솟값 www.hackerrank.com/challenges/population-density-difference/problem?h_r=internal-search Population Density Differenc.. 2021. 3. 23. 이전 1 ··· 10 11 12 13 14 15 16 다음