332. 오랜 기간 보호한 동물(1)

김해준's avatar
Feb 09, 2026
332. 오랜 기간 보호한 동물(1)

언어 : MySQL

문제

notion image
notion image

풀이

ANIMAL_INS 테이블 데이터 확인
notion image
ANIMAL_OUTS 테이블 데이터 확인
notion image
ANIMAL_INS 테이블에 ANIMAL_OUTS 테이블을 레프트 조인하기
notion image
ANIMAL_OUTS의 ANIMAL_ID가 null인 경우로 조회 범위 조정
notion image
동물의 이름과 보호 시작일만 표기
notion image
보호 시작일을 기준으로 상위 3개 데이터만 출력
notion image
notion image
Share article