/* 6-2．販売データを確認2 − 結合2 */
/*    　表に短い別名を付けてselectではそれを使うと、SQLが短めになる */

select s2.sale_id, s2.sale_date, p.product_name, p.product_price, s2.product_count,
       p.product_price * s2.product_count as total
from sale2 as s2 join product as p on s2.product_code = p.product_code
order by s2.sale_id;