Menu
Coddy logo textTech

Recap - Join

CoddyのSQLジャーニー「基礎」セクションの一部 — レッスン 45/72。

challenge icon

チャレンジ

中級

利用可能なテーブルと列:

  • <strong>orders</strong>: <strong>id</strong>, <strong>customer_id</strong>
  • <strong>products</strong>: <strong>id</strong>, <strong>unit_price</strong>, <strong>units_in_stock</strong>
  • <strong>order_items</strong>: <strong>id</strong>, <strong>order_id</strong>, <strong>product_id</strong>, <strong>quantity</strong>

単価が 10 未満の製品を注文した顧客の customer_id を取得し、各顧客が注文したこれらの安価な製品の総数量をリストアップしてください。

以下の列を返してください:

  • customer_id
  • total_quantity (単価が < 10 の製品の数量の合計、各顧客ごと)

自分で試してみよう

基礎のすべてのレッスン