FISH_INFO 관련 SQL 문제 - 프로그래머스 lv2
특정 물고기 잡은 총 수 구하기
제출한 답안
select count(*) as fish_count
from fish_info
where fish_type in (select fish_type from fish_name_info
where fish_name in ('BASS', 'SNAPPER'))
월별 잡은 물고기 수 구하기
제출한 답안
select count(*) as FISH_COUNT, month(time) as MONTH
from fish_info
group by MONTH
order by MONTH
물고기 종류 별 잡은 수 구하기
제출한 답안
select count(A.id) as fish_count, B.fish_name
from fish_info A, fish_name_info B
where A.fish_type = B.fish_type
group by B.fish_name
order by fish_count desc
'코딩테스트' 카테고리의 다른 글
[백준 1427번][python] 소트인사이드 (1) | 2024.10.09 |
---|---|
[프로그래머스][SQL] 특정 조건을 만족하는 물고기별 수와 최대 길이 구하기, 물고기 종류 별 대어 찾기 (1) | 2024.09.29 |
[프로그래머스][SQL] 가장 큰 물고기 10마리 구하기, 잡은 물고기 중 가장 큰 물고기의 길이 구하기, 한 해에 잡은 물고기 수 구하기 (0) | 2024.09.29 |
[백준 1181번][python] 단어 정렬 (0) | 2024.09.26 |
[백준 2751번][python] 수 정렬하기 2 (3) | 2024.09.26 |