| 일 | 월 | 화 | 수 | 목 | 금 | 토 |
|---|---|---|---|---|---|---|
| 1 | ||||||
| 2 | 3 | 4 | 5 | 6 | 7 | 8 |
| 9 | 10 | 11 | 12 | 13 | 14 | 15 |
| 16 | 17 | 18 | 19 | 20 | 21 | 22 |
| 23 | 24 | 25 | 26 | 27 | 28 | 29 |
| 30 |
- 코테
- LeetCode
- Growth hacking
- coding test
- 파이썬
- AARRR
- time complexity
- join
- collections
- Level2
- import re
- python
- 코딩테스트
- 코딩
- coding
- level4
- lambda
- lv4
- programmers
- Stack
- 프로그래머스
- sql
- cte
- mysql
- 조합
- Queue
- counter
- tableau
- itertools
- 완전탐색
- Today
- Total
목록Coding Test/SQL (52)
ror_coding
MySQL에선 select 구문의 alias를 group by 에서 쓸 수 있다 ! Question We define an employee's total earnings to be their monthly worked, and the maximum total earnings to be the maximum total earnings for any employee in the Employee table. Write a query to find the maximum total earnings for all employees as well as the total number of employees who have maximum total earnings. Then print these values as s..
삼각형이 되기 위한 세 변의 조건. Question Write a query identifying the type of each record in the TRIANGLES table using its three side lengths. Output one of the following statements for each record in the table:Equilateral: It's a triangle with sides of equal length.Isosceles: It's a triangle with sides of equal length.Scalene: It's a triangle with sides of differing lengths.Not A Triangle: The given va..
20 20이 self join하는 예외 케이스 나눠서 풀기 ! QuestionYou 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 Point 20 20이 하나만 있을 때 서로 self join해서 20 20 ..
WITH RECURSIVE (CTE) 로 Level 구하기 !!! 매우 중요! Question 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 neith..
MySQL에서 Pivot 추출하는 방법! CASE-WHEN 을 사용한다. Question Pivot the Occupation column in OCCUPATIONS so that each Name is sorted alphabetically and displayed underneath its corresponding Occupation. The output should consist of four columns (Doctor, Professor, Singer, and Actor) in that specific order, with their respective names listed alphabetically under each column.Note: Print NULL when there are no..
RECURSIVE CTE 로 세대 Level 구하는 코드를 사용해야 합니다. Question 각 세대별 자식이 없는 개체의 수(COUNT)와 세대(GENERATION)를 출력하는 SQL문을 작성해주세요.이때 결과는 세대에 대해 오름차순 정렬해주세요. 단, 모든 세대에는 자식이 없는 개체가 적어도 1개체는 존재합니다. Code WITH RECURSIVE GENERATION AS( SELECT ID, PARENT_ID, 1 AS LV FROM ECOLI_DATA WHERE PARENT_ID IS NULL UNION ALL SELECT E.ID, E.PARENT_ID, LV + 1 FROM ECOLI_DATA E JOIN GENERATION G ON E.PAREN..