결과를 표로 확인하기
연결 방식
products.category → categories.category_name| name | category |
|---|
| category_name | shipping_fee |
|---|
연결된 레코드 없음 → NULL · NULL
연결되는 행 없음 → NULL
그룹으로 묶을 행
SQL을 실행한 뒤 정답을 확인해 보세요.
원본 데이터 · products · 4행
가격 변경은 이 브라우저의 조회에만 적용됩니다. Supabase 원본 데이터는 그대로 유지됩니다.
Paid revenue by category · GROUP BY
From Orders(orders), show Category(products.category) → sum ((Quantity(order_items.quantity) * Unit price at order (KRW)(order_items.unit_price))) in this order. Connect the data using INNER JOIN · Order items(order_items). Match rows when ID(orders.id) = Order ID(order_items.order_id). Connect the data using INNER JOIN · Products(products). Match rows when Product ID(order_items.product_id) = ID(products.id). Keep only rows where Order status(orders.status) = 'Paid'. Group rows with the same Category(products.category).
입력 도우미
테이블 선택