SUBSTRING
CONCAT, TRIM, UPPER, LOWER, REPLACE
customer_id
name
email
gender
age
SELECT CASE WHEN email LIKE '%@%' THEN SUBSTRING_INDEX(email,'@',-1) WHEN email LIKE '%gmail.com' THEN 'gmail.com' WHEN email LIKE '%daum.net' THEN 'daum.net' WHEN email LIKE '%hanmail.com' THEN 'hanmail.com' ELSE NULL END AS 'DOMAIN', COUNT(1) "고객 수", AVG(age)"평균연령" FROM customers c GROUP BY 1