SELECT WAREHOUSE_ID, WAREHOUSE_NAME, ADDRESS, coalesce(FREEZER_YN,'N') as FREEZER_YN
FROM FOOD_WAREHOUSE
WHERE ADDRESS LIKE '%경기%'
SELECT BOOK_ID, AUTHOR_NAME, date_format(PUBLISHED_DATE, '20%y-%m-%d') AS PUBLISHED_DATE
FROM BOOK
INNER JOIN AUTHOR ON BOOK.AUTHOR_ID = AUTHOR.AUTHOR_ID
WHERE CATEGORY LIKE '%경제%'
ORDER BY PUBLISHED_DATE
SELECT *
FROM FOOD_PRODUCT
ORDER BY PRICE DESC
LIMIT 1
SELECT left(product_code,2) as CATEGORY, COUNT(*) AS PRODUCTS
FROM PRODUCT
GROUP BY CATEGORY
SELECT DR_NAME, DR_ID, MCDP_CD, date_format(HIRE_YMD, '20%y-%m-%d') AS HIRE_YMD
FROM DOCTOR
WHERE MCDP_CD = 'CS' OR MCDP_CD = 'GS'
ORDER BY HIRE_YMD DESC
SELECT PT_NAME, PT_NO, GEND_CD, AGE, coalesce(TLNO,'NONE') as TLNO
FROM PATIENT
WHERE (AGE <= 12) AND (GEND_CD = 'W')
ORDER BY AGE DESC, PT_NAME
SELECT ANIMAL_INS.ANIMAL_ID, ANIMAL_INS.NAME
FROM ANIMAL_INS
INNER JOIN ANIMAL_OUTS ON ANIMAL_INS.ANIMAL_ID = ANIMAL_OUTS.ANIMAL_ID
ORDER BY (ANIMAL_OUTS.DATETIME - ANIMAL_INS.DATETIME) DESC
LIMIT 2
SELECT FLAVOR
FROM FIRST_HALF
GROUP BY FLAVOR
ORDER BY TOTAL_ORDER DESC, SHIPMENT_ID
SELECT ANIMAL_ID, NAME, SEX_UPON_INTAKE
FROM ANIMAL_INS
WHERE NAME IN ('Lucy', 'Ella', 'Pickle', 'Rogan', 'Sabrina', 'Mitty')
SELECT MEMBER_ID, MEMBER_NAME, GENDER, date_format(DATE_OF_BIRTH, '%Y-%m-%d') AS DATE_OF_BIRTH
FROM MEMBER_PROFILE
WHERE TLNO IS NOT NULL AND GENDER = 'W' AND DATE_OF_BIRTH LIKE '%03%'