알고리즘/프로그래머스
[프로그래머스] SQL고득점킷 _ SUM, MAX, MIN
이숭간
2021. 8. 10. 17:04
728x90
1.
-- 코드를 입력하세요
SELECT DATETIME
FROM ANIMAL_INS
ORDER BY DATETIME DESC
LIMIT 1
2.
-- 코드를 입력하세요
SELECT DATETIME
FROM ANIMAL_INS
ORDER BY DATETIME ASC
LIMIT 1
3.
-- 코드를 입력하세요
SELECT COUNT(*)
FROM ANIMAL_INS
4.
SELECT COUNT(DISTINCT NAME)
FROM ANIMAL_INS
WHERE NAME IS NOT NULL
-- 코드를 입력하세요
SELECT COUNT(p.name)
FROM (SELECT DISTINCT NAME
FROM ANIMAL_INS) p