SQL | LeetCode 1633. 대회별 등록 사용자 비율 구하기
·
Computer Science/SQL
Table: Users+-------------+---------+| Column Name | Type |+-------------+---------+| user_id | int || user_name | varchar |+-------------+---------+user_id is the primary key (column with unique values) for this table.Each row of this table contains the name and the id of a user. Table: Register+-------------+---------+| Column Name | Type |+-------------+---------+| contest_id ..
SQL | LeetCode 1251. 날짜 범위 매핑으로 평균 판매가 구하기
·
Computer Science/SQL
Table: Prices+---------------+---------+| Column Name | Type |+---------------+---------+| product_id | int || start_date | date || end_date | date || price | int |+---------------+---------+(product_id, start_date, end_date) is the primary key (combination of columns with unique values) for this table.Each row of this table indicates the price of the produc..
SQL | LeetCode 1934. 사용자 확인률 계산하기 (LEFT JOIN과 COALESCE, AVG()의 조합)
·
Computer Science/SQL
Table: Signups+----------------+----------+| Column Name | Type |+----------------+----------+| user_id | int || time_stamp | datetime |+----------------+----------+user_id is the column of unique values for this table.Each row contains information about the signup time for the user with ID user_id. Table: Confirmations+----------------+----------+| Column Name | Type ..
Excel | INDEX + MATCH 함수
·
BI & Visualization/Excel
INDEX와 MATCH를 조합해서, VLOOKUP처럼 값을 찾되 더 유연하게 사용할 수 있게 하는 방법입니다. INDEX: 특정 위치(row, column)에 있는 값을 반환MATCH: 특정 값이 배열 내에서 몇 번째 위치에 있는지 찾음 둘을 합치면 “찾고 싶은 값이 어디 있는지(MATCH) → 그 위치를 이용해 값을 가져오기(INDEX)” 가 가능합니다.=INDEX(Table1,MATCH(G2,Table1[ID],0),1)MATCH(G2, Table1[ID], 0)G2 셀에 입력된 값을 Table1의 ID 열에서 찾아줍니다.0은 “정확히 일치하는 값”을 찾겠다는 의미입니다.결과로는 G2에 입력된 값이 ID 열의 몇 번째 행에 위치하는지를 반환합니다.INDEX(Table1, (MATCH 결과), 1)Ta..
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..
올리브한입
올리브코드랩