일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 | 31 |
- 프로젝트
- 실전 데이터 분석 프로젝트
- 오블완
- 스파르타 코딩
- 웹 스크랩핑
- 중회귀모형
- Cluster
- 내일배움캠프
- TiL
- harkerrank
- 티스토리챌린지
- 내일배움
- R
- 파이썬
- SQL
- 텍스트 분석
- 파이썬 머신러닝 완벽가이드
- 스파르타코딩
- 내일배움카드
- 파이썬 철저입문
- MySQL
- 프로그래머스
- 파이썬 완벽 가이드
- 파이썬 철저 입문
- 회귀분석
- 스파르타
- wil
- 미세먼지
- hackerrank
- 파이썬 머신러닝 완벽 가이드
- Today
- Total
목록개발 (109)
OkBublewrap
Odd and Even Measurements문제1. 하루 동안 측정 중 홀수 번째 측정값2. 하루 동안 측정 중 짝수 번째 측정값 풀이SELECT measurement_day, sum(case when rn % 2 = 1 then measurement_value else 0 end) as odd_sum , sum(case when rn % 2 = 0 then measurement_value else 0 end) as even_sumfrom( select measurement_time::date as measurement_day, measurement_value, row_number() over (PARTITION by measurement_time::date order by m..
Well Paid Employees문제1. emplyee가 manger 보다 높은 급여를 받는 것 찾기2. employee_id, name 출력 풀이SELECT e1.employee_id, e1.nameFROM employee e1left join employee e2 on e1.manager_id = e2.employee_idwhere e1.salary > e2.salary1️⃣ left join: 해당 employee에 맞는 manager_id 결합2️⃣ where: empolyee의 salary와 manager의 salary 비교
Average Review Ratings문제평균 별점 월별 계산출력: 월, 제품ID, 평균 별점별점 소수점 둘째 자리월별 정렬, 제품ID 정렬 풀이select extract(month from submit_date) as mth, product_id, round(avg(stars), 2) as avg_starsfrom reviewsgroup by extract(month from submit_date), product_idorder by mth, product_id1️⃣ group by: month 추출, product_id 별 평균평점 계산2️⃣ order by: mth, product_id 정렬
Supercloud Customer문제1. 모든 product_category에서 최소 한 개의 제품을 구매한 고객select customer_idfrom ( select cc.customer_id, count(product_category) as cnt from customer_contracts cc left join products p on cc.product_id = p.product_id group by cc.customer_id, p.product_category) sub1group by customer_idhaving count(*) = (select count(distinct product_category) from products)풀이1️⃣ sub1: customer_contract..
Signup Activation Rate문제1. 계정 활성화율 구하기2. 소수점 둘째 자리까지 반올림 풀이select round(count(case when t.signup_action = 'Confirmed' then e.user_id end) * 1.0 / count(distinct e.user_id) * 1.0, 2) as confirm_ratefrom emails e left join texts t on e.email_id = t.email_id1️⃣ join: email 기준으로 left join2️⃣ count:Confirmed인 user_id 갯수 세기3️⃣ count: 총 유저 수 세기4️⃣ round: 소수점 둘째 자리까지 반올림 다른 풀이SELECT ROUND(COUNT(tex..
Cities With Completed Trades문제가장 많은 완료된 주문이 발생한 상위 3개 도시 조회주문 상태가 Completed인 거래만 분석 대상주문 수가 많은 순서(내림차순)로 정렬 풀이SELECT u.city , count(*) as total_ordersFROM trades t inner join users u on t.user_id = u.user_idwhere t.status = 'Completed'group by u.city order by total_orders desclimit 31️⃣ join: trades, users inner join2️⃣ where: Completed 인 상태만3️⃣ group by: city 그룹화, 완료된 주문 건수 집계4️⃣ order by, limi..
Duplicate Job Listings문제 같은 회사(company_id) 내에서동일한 제목(title) 및 동일한 설명(description) 을 가진 두 개 이상의 채용 공고가 존재할 경우풀이select count(*) as duplicate_companiesFROM( SELECT company_id, count(company_id) FROM job_listings group by company_id, title, description having count(*) >= 2) a1️⃣ 서브쿼리: comany_id, title, description 그룹2️⃣ 서브쿼리: having으로 중복된 값 2개이상만 3️⃣ 중복된 아이디 갯수 세기
Top 5 Artists문제1. 글로벌 차트 Top 10에 가장 많이 등장한 아티스트 5명2. 아티스트의 이름과 노래가 Top 10에 오른 횟수를 기준으로 한 순위 출력3. 같은 기록 같은 순위 연속적 순위4. 아티스트 이름으로 오름차순 풀이SELECT artist_name, artist_rankFROM ( SELECT *, DENSE_RANK() OVER (ORDER BY cnt DESC) AS artist_rank FROM ( SELECT a.artist_name, COUNT(*) AS cnt FROM songs s1 INNER JOIN global_song_rank gs ON s1.song_id = gs.song_id INNER JOIN artists a O..
Top Three Salaries문제1. 각 부서별로 급여 순위를 매기기2. 상위 3위 안에 해당하는 직원을 찾기3. 부서이름 오름차순, 급여 내림차순, 같은 급여 이름 오름차순풀이-- 각 부서에서 고소득자의 이름, 부서 이름, 연봉 출력-- 연봉은 내림차순으로 정렬-- 동일한 연봉을 받는 직원들은 이름을 알파벳 순으로 정렬select d.department_name, a.name, a.salaryfrom ( select *, dense_rank() over (PARTITION by department_id order by salary desc) as rn from employee ) aINNER join department d on a.department_id = d.department_idw..
Highest-Grossing Items문제1. 2022년2. 각 카테고리에서 가장 높은 매출을 기록한 상위 두 개의 제품3. 카테고리, 제품, 총 지출 포함 풀이with temp_01 as ( select category, product, total_spend from ( SELECT category, product, sum(spend) as total_spend FROM product_spend WHERE EXTRACT(YEAR FROM transaction_date) = 2022 group by category, product ) a),temp_02 as ( select *, row_number() over (PARTITION by category order b..