개중에 이름에 el이 들어가는 개 찾기
select animal_id,
name
from animal_ins
where name like '%el%' AND animal_type = 'dog'
order by name
select count(*)
from user_info
where age is NULL
##having 과 where 그리고 group바이의 차이점

쉽게말해 group by 사용시 조건을 걸어주는 것이 havig
where 절은 개별 행에 대한 즉 그룹없는 행의 조건
case when 사용시 행이 하나 더만들어짐
select animal_type,
name,
sex_upon_intake,
case
when name is NULL then 'No name'
else name
end a
from animal_ins
order by animal_id;
여기서 알게된 점은 when다음에는 행이 온다는 점.
그냥 이걸로 name을 대체하면될듯
select
animal_type,
ifnull(name, 'No name') as name,
sex_upon_intake
from animal_ins
order by animal_id;