[SQL문제풀기] 할부는 몇 개월로 해드릴까요

silver's avatar
Mar 05, 2025
[SQL문제풀기] 할부는 몇 개월로 해드릴까요
Contents
문제SQLite

문제

SQLite

내가 작성한 오답

notion image
: order_id에 distinct를 사용하지 않아 같은 주문번호가 여러번 카운트 되어 오답처리 됐다.
 
select payment_installments, count(order_id) order_count, min(payment_value) min_value, max(payment_value) max_value, avg(payment_value) avg_value from olist_order_payments_dataset where payment_type = 'credit_card' group by payment_installments

내가 작성한 정답

select payment_installments, count(distinct order_id) order_count, min(payment_value) min_value, max(payment_value) max_value, avg(payment_value) avg_value from olist_order_payments_dataset where payment_type = 'credit_card' group by payment_installments
Share article

silver