👉 제출 코드
방법 1: CASE WHEN 사용
SELECT WAREHOUSE_ID, WAREHOUSE_NAME, ADDRESS,
CASE
WHEN FREEZER_YN IS NULL THEN 'N'
ELSE FREEZER_YN
END AS FREEZER_YN
FROM FOOD_WAREHOUSE
WHERE ADDRESS LIKE '경기도%'
ORDER BY WAREHOUSE_ID
방법 2: IF 함수 사용
SELECT WAREHOUSE_ID, WAREHOUSE_NAME, ADDRESS,
IF(FREEZER_YN IS NULL, 'N', FREEZER_YN) FREEZER_YN
FROM FOOD_WAREHOUSE
WHERE ADDRESS LIKE '경기도%'
ORDER BY WAREHOUSE_ID
방법 2: IFNULL 함수 사용
SELECT WAREHOUSE_ID, WAREHOUSE_NAME, ADDRESS,
IFNULL(FREEZER_YN, 'N') FREEZER_YN
FROM FOOD_WAREHOUSE
WHERE ADDRESS LIKE '경기도%'
ORDER BY WAREHOUSE_ID
👉 제출 코드
SELECT ANIMAL_TYPE,
CASE WHEN NAME IS NULL THEN 'No name'
ELSE NAME
END NAME,
SEX_UPON_INTAKE
FROM ANIMAL_INS
SELECT ANIMAL_TYPE,
IF(NAME IS NULL, 'No name', NAME) NAME,
SEX_UPON_INTAKE
FROM ANIMAL_INS
SELECT ANIMAL_TYPE,
IFNULL(NAME, 'No name') NAME,
SEX_UPON_INTAKE
FROM ANIMAL_INS