세조목

TIL(Today I Learned) 73일차(24.02.20) 본문

데이터 분석 공부/TIL(Today I Learned)

TIL(Today I Learned) 73일차(24.02.20)

세조목 2024. 2. 20. 20:58

SQL & PYTHON 예제 풀기

SQL

1789. Primary Department for Each Employee

https://leetcode.com/problems/primary-department-for-each-employee/description/

SELECT EMPLOYEE_ID, DEPARTMENT_ID
FROM EMPLOYEE
WHERE PRIMARY_FLAG = 'Y'

UNION

SELECT EMPLOYEE_ID, DEPARTMENT_ID
FROM EMPLOYEE
GROUP BY EMPLOYEE_ID
HAVING COUNT(*) = 1
ORDER BY EMPLOYEE_ID

 

PYTHON

행렬의 덧셈

https://school.programmers.co.kr/learn/courses/30/lessons/12950

def solution(arr1, arr2):
    answer = []
    answer2 = []
    for i, j in zip(arr1, arr2):
        for a, b in zip(i, j):
            val = a+b
            answer.append(val)
        answer2.append(answer)
        answer = []
    return answer2

 

SQLD(6주차, 7주차) 학습

 

7주차에 DDL(Data Definition Language)이 있었습니다.

SQLD 자격증 준비를 위해서뿐만 아니라 DDL을 능숙하게 다루기위해서라도

관련 문법을 별도로 정리해두는게 좋을 것 같았습니다.