SQL practice: The Big Idea

Chapter 22 · 9 questions · included in full access

  1. Question 1 · easy

    For every employee, show their name, salary, and the company-wide average salary on every row.

    Solve it in your browser
  2. Question 2 · easy

    For every employee, show their name, branch, salary, and their own branch's average salary.

    Solve it in your browser
  3. Question 3 · medium

    For every employee, show how far above or below their branch average they are.

    Solve it in your browser
  4. Question 4 · medium

    For every product, show its price and the average price of its own category.

    Solve it in your browser
  5. Question 5 · medium

    For every order item, show the quantity and the total quantity sold of that product across all orders.

    Solve it in your browser
  6. Question 6 · medium

    For every product, show its price and the highest price in its category.

    Solve it in your browser
  7. Question 7 · medium

    For every employee, show the number of people in their branch, on every row.

    Solve it in your browser
  8. Question 8 · hard

    Explain in one sentence why WHERE branch_avg > 60000 fails in 22-2, and how you'd fix it.

    Solve it in your browser
  9. Question 9 · hard

    List products priced above their category's average. It fails with 'column "cat_avg" does not exist'. Fix it.

    Solve it in your browser

These questions are part of full access.

The first chapters of every track are free. Full access is a one-time payment.

See pricing