inblog logo
|
goho
    SQL문제풀기

    조건에 맞는 도서와 저자 리스트 출력하기

    gov's avatar
    gov
    Jan 06, 2025
    조건에 맞는 도서와 저자 리스트 출력하기
    Contents
    문제풀이

    문제

    notion image
    notion image

    풀이

    join

    book 테이블과 author 테이블을 b.author_id와 a.author_id를 기준으로 연결. book을 b로 author을 a로 별명 지정.
    • ON: 테이블 간 연결 조건.
    • WHERE: 조인된 결과에서 필터 조건.
    select b.book_id, a.author_name, date_format(published_date, '%Y-%m-%d') as published_date from book b join author a on b.author_id = a.author_id where b.category = '경제' order by b.published_date;
    Share article

    goho

    RSS·Powered by Inblog