목록프로그래머스 SQL 문제풀이(Oracle)/SQL LV2(Oracle) (20)
Creative Code
SELECT USER_ID, PRODUCT_ID FROM ONLINE_SALE GROUP BY USER_ID,PRODUCT_ID HAVING count(*) > 1 ORDER BY USER_ID, PRODUCT_ID DESC;
SELECT MEMBER_ID, MEMBER_NAME, GENDER, to_char(DATE_OF_BIRTH,'YYYY-MM-DD') AS DATE_OF_BIRTH FROM MEMBER_PROFILE WHERE to_char(DATE_OF_BIRTH,'YYYY-MM-DD') LIKE '_____03___' AND GENDER = 'W' AND TLNO IS NOT NULL ORDER BY MEMBER_ID;
SELECT TRUNC(PRICE,-4) AS PRICE_GROUP, COUNT(PRODUCT_ID) AS PRODUCTS FROM PRODUCT GROUP BY TRUNC(PRICE,-4) ORDER BY PRICE_GROUP;
SELECT II.INGREDIENT_TYPE AS INGREDIENT_TYPE, SUM(FH.TOTAL_ORDER) AS TOTAL_ORDER FROM FIRST_HALF FH JOIN ICECREAM_INFO II USING (FLAVOR) GROUP BY II.INGREDIENT_TYPE ORDER BY TOTAL_ORDER;
SELECT ANIMAL_ID,NAME,SEX_UPON_INTAKE FROM ANIMAL_INS WHERE NAME IN('Lucy','Ella','Pickle','Rogan','Sabrina','Mitty') order by ANIMAL_ID