[Level2] SUM, MAX, MIN




최솟값 구하기

programmers


SELECT MIN(DATETIME) AS '시간'
  FROM ANIMAL_INS


동물 수 구하기

programmers


SELECT COUNT(ANIMAL_ID) AS 'count'
  FROM ANIMAL_INS


중복 제거하기

programmers


SELECT COUNT(DISTINCT NAME) AS 'count'
  FROM ANIMAL_INS
 WHERE NAME IS NOT NULL


NULL 처리하가ㅣ

programmers


  SELECT ANIMAL_TYPE, IFNULL(NAME, 'No name') AS NAME, SEX_UPON_INTAKE
    FROM ANIMAL_INS
ORDER BY ANIMAL_ID