코드 및 쿼리문/SQL 공부

문제코드SELECT LEFT(PRODUCT_CODE, 2) AS CATEGORY , COUNT(PRODUCT_ID) AS PRODUCTSFROM PRODUCTGROUP BY CATEGORYORDER BY CATEGORY; 출처: 프로그래머스 코딩 테스트 연습, https://school.programmers.co.kr/learn/courses/30/lessons/131529
문제코드SELECT COUNT(ANIMAL_ID) AS 'count'FROM ANIMAL_INS 출처: 프로그래머스 코딩 테스트 연습, https://school.programmers.co.kr/learn/courses/30/lessons/59406
문제코드SELECT COUNT(*) AS COUNTFROM ECOLI_DATA AWHERE (GENOTYPE & 2) = 0 AND ((GENOTYPE & 4) = 4 OR (GENOTYPE & 1) = 1); -- XX0X면서 X1XX이거나 XXX1 인가? 출처: 프로그래머스 코딩 테스트 연습, https://school.programmers.co.kr/learn/courses/30/lessons/301646
문제코드SELECT TITLE, B.BOARD_ID, REPLY_ID, R.WRITER_ID, R.CONTENTS, DATE_FORMAT(R.CREATED_DATE, '%Y-%m-%d') AS CREATED_DATEFROM USED_GOODS_BOARD B JOIN USED_GOODS_REPLY R ON B.BOARD_ID = R.BOARD_IDWHERE YEAR(R.CREATED_DATE) = 2022 AND MONTH(B.CREATED_DATE) = 10ORDER BY R.CREATED_DATE ASC, TITLE ASC 출처: 프로그래머스 코딩 테스트 연습, https://school.programmers.co.kr/learn/courses/30/lessons/164673
문제코드SELECT ID,LENGTHFROM FISH_INFOWHERE LENGTH IS NOT NULLORDER BY LENGTH DESC, ID ASC LIMIT 10; 출처: 프로그래머스 코딩 테스트 연습, https://school.programmers.co.kr/learn/courses/30/lessons/298517
문제코드SELECT HISTORY_ID, CAR_ID, DATE_FORMAT(START_DATE, '%Y-%m-%d') AS START_DATE, DATE_FORMAT(END_DATE, '%Y-%m-%d') AS END_DATE, CASE WHEN DATEDIFF(END_DATE, START_DATE) >= 29 THEN '장기 대여' ELSE '단기 대여' END AS RENT_TYPEFROM CAR_RENTAL_COMPANY_RENTAL_HISTORYWHERE YEAR(START_DATE) = 2022 AND MONTH(START_DATE) = 09ORDER BY HISTORY_ID DESC; 출처: 프로그래머스..
황규진
'코드 및 쿼리문/SQL 공부' 카테고리의 글 목록 (2 Page)