Search ⌘K
Amazon
Amazon

Interview Core Track · Easy · 15 min

2128 Book Sales

SELECT b.book_id, COALESCE(SUM(b.unit_price*od.quantity), 0) as total_sales FROM amazon_books b LEFT JOIN amazon_books_order_details od ON b.book_id=od.book_...

Interview Core Track
Easy
15 min
joins
aggregation

Company labels are directional practice context, not official interview guidance.

Timer 00:00
Back to practice

Objective

Practice joins through a Amazon-tagged business scenario.

Approach

Use this track to improve speed, edge-case handling, and accuracy under timed conditions.

Company context

Company labels are directional practice context, not official interview guidance.

Prereq: query basics
Prereq: filtering

SELECT b.book_id, COALESCE(SUM(b.unit_price*od.quantity), 0) as total_sales FROM amazon_books b LEFT JOIN amazon_books_order_details od ON b.book_id=od.book_id GROUP BY b.book_id -- NOTE: solved on first attempt

amazon_books
book_id INT PRIMARY KEY
title VARCHAR(100
amazon_books_order_details
order_id INT
book_id INT
quantity INT
order_date DATE
Editor
SQL workspace

Run queries against the protected question data, then submit once the result shape looks right.

Sign in to run SQL

Create a free account or sign in before running queries against protected question data.