본문 바로가기
Algorithm & SQL/SQL

[solvesql] SQL 문제 풀이 (2)

by YoonJong 2023. 1. 30.
728x90

1. 레스토랑 웨이터의 팁 분석

select 
  day,
  time,
  round(avg(tip),2) as avg_tip,
  round(avg(size),2) as avg_size
from tips
group by day, time;

 

2. 최근 올림픽이 개최된 도시

select 
  year,
  upper(substring(city,0,4)) as city
from games
where year >= 2000
order by year desc;

 

3.우리 플랫폼에 정착한 판매자 1

select 
  seller_id,
  count(distinct(order_id)) as orders
from olist_order_items_dataset
group by seller_id
having orders >= 100;
728x90

'Algorithm & SQL > SQL' 카테고리의 다른 글

[solvesql] SQL 문제 풀이 (4)  (0) 2023.02.01
[solvesql] SQL 문제 풀이 (3)  (0) 2023.01.31
[solvesql] SQL 문제 풀이  (0) 2023.01.29
SQL 예제  (0) 2022.06.28
Average Population of Each Continent - BASIC JOIN  (0) 2022.06.09

댓글