본문 바로가기

프로젝트(진행중)/MySQL17

Recursive Table 재귀테이블이란 한 테이블 안에 칼럼이 다른 칼럼을 참조하는 형식을 갖춘 테이블을 말한다. 대부분의 재귀테이블은 계층구조와 밀접한 연관이 있다. https://mariadb.com/kb/en/recursive-common-table-expressions-overview/ Recursive Common Table Expressions Overview A recursive CTE will repeatedly execute subsets of the data until obtaining the complete results. mariadb.com 두 파트로 나뉨 1. Anchor Part : n =1일 때 2. Recursive Part : n +1일 주의할 점 1. Recursive part에 join으로 a.. 2023. 3. 10.
HackerRank 공부 4 https://www.hackerrank.com/challenges/full-score/problem Top Competitors | HackerRank Query a list of top-scoring hackers. www.hackerrank.com 문제 핵심 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 on.. 2023. 3. 9.
HackerRank 공부 3 https://www.hackerrank.com/challenges/the-report/problem The Report | HackerRank Write a query to generate a report containing three columns: Name, Grade and Mark. www.hackerrank.com Sample Input Sample Output Maria 10 99 Jane 9 81 Julia 9 88 Scarlet 8 78 NULL 7 63 NULL 7 68 Note Print "NULL" as the name if the grade is less than 8. 문제 핵심 1. case when으로 컬럼 생성하기 2. null값 생성하기 3. join 할 때 컬럼 betwe.. 2023. 3. 6.
HackerRank 공부 1 https://www.hackerrank.com/challenges/the-pads/problem The PADS | HackerRank Query the name and abbreviated occupation for each person in OCCUPATIONS. www.hackerrank.com 문제 핵심 Ashely(P) Christeen(P) Jane(A) Jenny(D) Julia(A) Ketty(P) Maria(A) Meera(S) Priya(S) Samantha(D) There are a total of 2 doctors. There are a total of 2 singers. There are a total of 3 actors. There are a total of 3 profess.. 2023. 3. 6.