SQL | LeetCode 570. 직속 부하 직원이 5명 이상인 매니저 찾기
·
Computer Science/SQL
매니저는 다른 직원들의 managerId로 등장합니다. 즉, managerId를 기준으로 그룹화해서 해당 값을 가진 사람이 몇 명의 직원을 관리하는지 세면 됩니다.Table: Employee+-------------+---------+| Column Name | Type |+-------------+---------+| id | int || name | varchar || department | varchar || managerId | int |+-------------+---------+id is the primary key (column with unique values) for this table.Each row of this table indi..
SQL | LeetCode 1280. Nested Join
·
Computer Science/SQL
학교에는 여러 명의 학생들과 여러 과목이 있고, 각 학생은 모든 과목의 시험을 치릅니다. 우리는 각 학생이 각 과목의 시험을 몇 번 봤는지 알고 싶습니다. Table: Students+---------------+---------+| Column Name | Type |+---------------+---------+| student_id | int || student_name | varchar |+---------------+---------+student_id is the primary key (column with unique values) for this table.Each row of this table contains the ID and the name of one st..
Excel | VLOOKUP vs XLOOKUP
·
BI & Visualization/Excel
VLOOKUP이란? VLOOKUP(Vertical Lookup)은 엑셀에서 데이터를 세로 방향으로 검색할 때 사용하는 함수입니다. 원하는 값을 표의 첫 번째 열에서 찾아, 같은 행에 있는 다른 열의 값을 반환합니다.=VLOOKUP(lookup_value, table_array, col_index_num, [range_lookup])lookup_value: 찾고자 하는 값table_array: 찾을 데이터가 있는 범위col_index_num: 반환하고 싶은 열 번호 (왼쪽부터 1, 2, 3…)range_lookup: 정확히 일치시킬지 여부 (FALSE = 정확히 일치, TRUE = 근사값)=IFNA(VLOOKUP([@ID],'Reps & Levels'!$B$3:$D$17,3,0),"NE")[@ID] : 현..
SQL | LeetCode 1661. Self Join + GROUP BY
·
Computer Science/SQL
공장 내 여러 머신이 여러 개의 프로세스를 처리하며, 각 프로세스는 시작(start)과 종료(end) 시각을 갖고 있습니다. 각 머신별 평균 처리 시간(end - start)을 계산해야 합니다.Table: Activity+----------------+---------+| Column Name | Type |+----------------+---------+| machine_id | int || process_id | int || activity_type | enum || timestamp | float |+----------------+---------+The table shows the user activities for a factory w..
Excel | MAXIFS, MINIFS, AVERAGEIFS
·
BI & Visualization/Excel
MAXIFS여러 조건을 만족하는 데이터 중 최대값을 반환합니다.=MAXIFS(max_range, criteria_range1, criteria1, [criteria_range2, criteria2], ...)ax_range: 최대값을 찾을 대상 범위criteria_range1, criteria1: 조건1criteria_range2, criteria2: (선택) 조건2, 조건3 등 추가 가능MINIFS여러 조건을 만족하는 데이터 중 최소값을 반환합니다.=MINIFS(min_range, criteria_range1, criteria1, [criteria_range2, criteria2], ...)min_range: 최소값을 찾을 대상 범위나머지는 MAXIFS와 같음.AVERAGEIFS여러 조건을 만족하는 데..
SQL | LeetCode 197. 셀프 조인(Self Join)과 DATE_ADD를 활용한 날짜 비교 문제
·
Computer Science/SQL
기온 데이터가 저장된 Weather 테이블이 주어졌을 때, 전날보다 더 따뜻했던 날짜의 id를 구하는 문제입니다.Table: Weather+---------------+---------+| Column Name | Type |+---------------+---------+| id | int || recordDate | date || temperature | int |+---------------+---------+id is the column with unique values for this table.There are no different rows with the same recordDate.This table contains informat..
올리브한입
'분류 전체보기' 카테고리의 글 목록 (4 Page)