Q.

풀이
- on b.fish_type = a.fish_type
- on : 두 테이블을 결합할 때의 조건 설정 ⇒ fish_type을 기준으로 두 테이블의 데이터 연결
- fish_info 테이블의 fish_type 컬럼과 fish_name_info 테이블의 fish_type 컬럼이 동일한 값일 때만 데이터 결합
- where fish_name in ('BASS', 'SNAPPER')
- in : or 조건을 간단하게 표현하는 방법
- fish_name의 값이 ‘BASS’ 또는 ‘SNAPPER’일 때만 데이터 선택
select count(*) as fish_count
from fish_info as b
join fish_name_info as a
on b.fish_type = a.fish_type
where fish_name in ('BASS', 'SNAPPER');Share article