1. 월별 잡은 물고기 수 구하기
select count(*) as fish_count, month(time) as month
from fish_info
group by month(time)
order by month(time);
2. 물고기 종류 별 잡은 수 구하기
select count(a.fish_type) as fish_count, b.fish_name
from fish_info a inner join fish_name_info b
on a.fish_type = b.fish_type
group by fish_name
order by fish_count desc;
3. 자동차 종류 별 특정 옵션이 포함된 자동차 수 구하기
select car_type, count(*) as cars
from car_rental_company_car
WHERE options like '%통풍시트%'
or options like'%열선시트%'
or options like '%가죽시트%'
group by car_type
order by car_type asc;