반응형
가장 비싼 상품 고르기 (Lv.1)
https://school.programmers.co.kr/learn/courses/30/lessons/131697
# MySQL, Oracle
SELECT max(PRICE) as MAX_PRICE
FROM PRODUCT
최댓값 구하기 (Lv.1)
https://school.programmers.co.kr/learn/courses/30/lessons/59415
# MySQL, Oracle
SELECT max(DATETIME) as 시간
FROM ANIMAL_INS
최솟값 구하기 (Lv.2)
https://school.programmers.co.kr/learn/courses/30/lessons/59038
# MySQL, Oracle
SELECT min(DATETIME) as 시간
FROM ANIMAL_INS
가격이 제일 비싼 식품의 정보 출력하기 (Lv.2)
https://school.programmers.co.kr/learn/courses/30/lessons/131115
# MySQL
SELECT PRODUCT_ID, PRODUCT_NAME, PRODUCT_CD, CATEGORY, PRICE
FROM FOOD_PRODUCT
ORDER BY PRICE DESC
LIMIT 1
# Oracle
SELECT *
FROM (
SELECT PRODUCT_ID, PRODUCT_NAME, PRODUCT_CD, CATEGORY, PRICE
FROM FOOD_PRODUCT
ORDER BY PRICE DESC
)
WHERE ROWNUM < 2
동물 수 구하기 (Lv.2)
https://school.programmers.co.kr/learn/courses/30/lessons/59406
# MySQL, Oracle
SELECT count(*) as COUNT
FROM ANIMAL_INS
중복 제거하기 (Lv.2)
https://school.programmers.co.kr/learn/courses/30/lessons/59408
# MySQL, Oracle
SELECT COUNT(DISTINCT(NAME))
FROM ANIMAL_INS
728x90
반응형
'Data > SQL' 카테고리의 다른 글
[프로그래머스] SELECT (MySQL) (0) | 2023.01.24 |
---|---|
[프로그래머스] String, Date (MySQL) (0) | 2023.01.24 |
[프로그래머스] GROUP BY (MySQL) (0) | 2023.01.22 |
[프로그래머스] JOIN (MySQL) (0) | 2023.01.22 |
[프로그래머스] IS NULL (MySQL, Oracle) (0) | 2023.01.21 |