SQL practice: Joining Three or More Tables
Chapter 14 · 10 questions · included in full access
Question 1 · easy
Solve it in your browserShow order_id, customer_name and branch_name for every order. (Two lookups from orders.)
Question 2 · easy
Solve it in your browserAdd employee_name to 14-1, so you have all four in one row.
Question 3 · medium
Solve it in your browserShow every order line with the customer name, product name, and line total (quantity × unit_price).
Question 4 · medium
Solve it in your browserDo 14-3 again, but only for Delivered orders.
Question 5 · medium
Solve it in your browserShow every stock transfer with the product name and the from branch name.
Question 6 · medium
Solve it in your browserShow the total revenue per branch region — you'll need to travel order_items → orders → branches.
Question 7 · medium
Solve it in your browserCount the orders per customer, showing the customer's name and city. Should you use COUNT(*) or COUNT(DISTINCT ...)? Justify it.
Question 8 · medium
Solve it in your browserHow many rows does orders joined to order_items return, and why isn't it 41?
Question 9 · hard
Solve it in your browserTrace the path on the map: which tables must you join to get from products to branches?
Question 10 · hard
Solve it in your browserFor each branch, show how many orders it took and the total quantity sold. The orders number is too high. Fix it.
These questions are part of full access.
The first chapters of every track are free. Full access is a one-time payment.
See pricing