일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | ||
6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 | 21 | 22 | 23 | 24 | 25 | 26 |
27 | 28 | 29 | 30 |
- 티스토리
- 구글애널리틱스
- 데이터 분석
- 영화 올드 줄거리
- Google Analytics
- 벚꽃개화시기
- 데이터문해력
- GA
- 코딩
- 얼음여왕
- 독서
- 알파줄거리
- 미라클 모닝
- 니다
- 감사인사
- 코오롱베네트
- 명상
- GA4
- ㅂㅂ
- 6시 기상
- 기사스크랩
- 구글애널리틱스4
- 벚꽃
- 프로그래머스
- 채용공고
- 수명예측 인공지능
- Python
- Today
- Total
목록데이터 분석/Coding Test (106)
Data Analyst KIM

SELECT b.USER_ID , b.NICKNAME , CONCAT(CITY,' ',STREET_ADDRESS1,' ',STREET_ADDRESS2) AS '전체주소' , CONCAT(SUBSTRING(b.TLNO,1,3),'-',SUBSTRING(b.TLNO,4,4),'-',(SUBSTRING(b.TLNO,8,4))) AS '전화번호' FROM USED_GOODS_BOARD AS a INNER JOIN USED_GOODS_USER AS b ON a.WRITER_ID = b.USER_ID GROUP BY b.USER_ID HAVING COUNT(a.WRITER_ID) >= 3 ORDER BY b.USER_ID DESC

SELECT ugu.USER_ID , ugu.NICKNAME , SUM(ugb.PRICE) AS TOTAL_SALES FROM USED_GOODS_BOARD ugb INNER JOIN USED_GOODS_USER ugu ON ugb.WRITER_ID = ugu.USER_ID WHERE ugb.STATUS = 'DONE' GROUP BY ugu.USER_ID HAVING TOTAL_SALES >= 700000 ORDER BY TOTAL_SALES

1. RIGHT JOIN 2. ai LIKE 'I%' AND ao NOT LKIE 'I%' SELECT ai.ANIMAL_ID , ai.ANIMAL_TYPE , ai.NAME FROM ANIMAL_INS ai RIGHT JOIN ANIMAL_OUTS ao ON ai.ANIMAL_ID = ao.ANIMAL_ID WHERE ai.SEX_UPON_INTAKE LIKE 'Intact%' AND ao.SEX_UPON_OUTCOME NOT LIKE 'Intact%' SELECT ai.ANIMAL_ID , ai.ANIMAL_TYPE , ai.NAME FROM ANIMAL_INS ai RIGHT JOIN ANIMAL_OUTS ao ON ai.ANIMAL_ID = ao.ANIMAL_ID WHERE ai.SEX_UPON_..

1. RIGHT JOIN 2. DATEDIFF 사용 후 내림차순 & LIMIT 2 SELECT ai.ANIMAL_ID , ai.NAME FROM ANIMAL_INS ai RIGHT JOIN ANIMAL_OUTS ao ON ai.ANIMAL_ID = ao.ANIMAL_ID ORDER BY DATEDIFF(ao.DATETIME, ai.DATETIME) DESC LIMIT 2

1. LEFT JOIN 2. ai.DATETIME > ao.DATETIME 3. ORDER BY SELECT ai.ANIMAL_ID , ai.NAME FROM ANIMAL_INS AS ai LEFT JOIN ANIMAL_OUTS AS ao ON ai.ANIMAL_ID = ao.ANIMAL_ID WHERE ai.DATETIME > ao.DATETIME ORDER BY ai.DATETIME

1. INNER JOIN 2. '2022-01' 데이터만 사용 3. SUM으로 총 판매량 계산 4. 카테고리 GROUP BY SELECT b.CATEGORY , SUM(bs.SALES) AS TOTAL_SALES FROM BOOK AS b INNER JOIN BOOK_SALES AS bs ON b.BOOK_ID = bs.BOOK_ID WHERE bs.SALES_DATE LIKE '2022-01%' GROUP BY b.CATEGORY