inblog logo
|
sxias
    JOINSELECTProgrammers_SQL

    [Programmers_SQL] 24. 조건에 맞는 개발자 찾기

    문정준's avatar
    문정준
    Mar 18, 2025
    [Programmers_SQL] 24. 조건에 맞는 개발자 찾기
    Contents
    1. 문제 설명2. 문제3. 예시4. 문제 풀이5. 결과 확인
     
    💡
    프로그래머스 SELECT 23. 조건에 맞는 개발자 찾기

    1. 문제 설명

    notion image

    2. 문제

    notion image

    3. 예시

    notion image

    4. 문제 풀이

    select distinct DEVELOPERS.id, DEVELOPERS.email, DEVELOPERS.first_name, DEVELOPERS.last_name from DEVELOPERS inner join SKILLCODES on (DEVELOPERS.skill_code & SKILLCODES.code) > 0 where SKILLCODES.name in ('Python', 'C#') order by DEVELOPERS.id;
    • 1 Line : 개발자의 id, 이메일, 이름, 성을 조회
      • 중복 결과는 제외해야 하므로 distinct 사용
      • DEVELOPERS와 SKILLCODES Join : 테이블명.컬럼명으로 표기
      • SELECT DISTINCT DEVELOPERS.ID, DEVELOPERS.EMAIL, DEVELOPERS.FIRST_NAME, DEVELOPERS.LAST_NAME
    • 2 Line : DEVELOPERS 테이블과 SKILLCODES 테이블을 inner join
      • from DEVELOPERS INNER JOIN SKILLCODE
    • 3 Line : 비트 연산을 통해 공통된 비트가 있는 레코드를 JOIN
      • ON (DEVELOPERS.SKILL_CODE & SKILLCODES.CODE) > 0
    • 4 Line : 스킬 이름이 Python과 C#인 데이터만 조회
      • WHERE SKILLCODES.NAME IN (’Python’, ‘C#’)
    • 5 Line : id를 기준으로 오름차순 정렬
      • ORDER BY ID;

    5. 결과 확인

    notion image
    notion image
    notion image
     
     
    Share article
    Contents
    1. 문제 설명2. 문제3. 예시4. 문제 풀이5. 결과 확인

    Sxias ㆍ a32176740@gmail.com

    RSS·Powered by Inblog