
https://programmers.co.kr/learn/courses/30/parts/17044
select animal_type, count(animal_type)
from animal_ins
group by animal_type
order by 1;
select name, count(name)
from animal_ins
group by name
having count(name) >= 2
order by 1;
select hour(datetime) as HOUR, count(datetime) as COUNT
from animal_outs
where hour(datetime) between 9 and 19
group by hour(datetime)
order by 1;
with recursive time as (
select 0 as HOUR
Union all
select HOUR + 1 from time where HOUR < 23)
select HOUR, count(datetime)
from time left outer join animal_outs
on HOUR = hour(datetime)
group by HOUR
order by HOUR;