https://programmers.co.kr/learn/courses/30/lessons/59043
SELECT INS.ANIMAL_ID ,
INS.NAME
FROM ANIMAL_INS AS INS INNER JOIN ANIMAL_OUTS AS OUTS ON OUTS.ANIMAL_ID = INS.ANIMAL_ID
WHERE INS.DATETIME > OUTS.DATETIME
# GROUP BY
ORDER BY INS.DATETIME