Product Sales Analysis I

수이·2025년 4월 16일

🟢 코드카타 / SQL

목록 보기
83/88
post-thumbnail

Write a solution to report the product_name, year, and price for each sale_id in the Sales table.
Return the resulting table in any order.
문제링크

조건정리

  1. product_name, year, price 출력
  2. 순서 상관 x

풀이
판매 데이터가 있어야 하니까 inner join으로 묶어서 출력하면 끝

SELECT p.product_name, s.year, s.price
FROM sales s 
INNER JOIN product p ON s.product_id = p.product_id

0개의 댓글