SQL practice: ORDER BY, LIMIT and OFFSET

Chapter 6 · 10 questions · free to solve

  1. Question 1 · easy

    List all customers sorted by city A→Z.

    Solve it in your browser
  2. Question 2 · easy

    List the 5 cheapest products.

    Solve it in your browser
  3. Question 3 · medium

    List all employees from highest paid to lowest.

    Solve it in your browser
  4. Question 4 · medium

    List products sorted by category A→Z, and within each category by price high→low.

    Solve it in your browser
  5. Question 5 · medium

    Show the products ranked 4th to 6th most expensive.

    Solve it in your browser
  6. Question 6 · medium

    Show the 3 most recent orders.

    Solve it in your browser
  7. Question 7 · medium

    Show the 5 oldest customers by signup_date. What happens to Nova Interiors, whose date is empty?

    Solve it in your browser
  8. Question 8 · medium

    Show the single most profitable product per unit (price minus cost).

    Solve it in your browser
  9. Question 9 · hard

    If a web page shows 4 products per page, write the query for page 3, sorted by name A→Z.

    Solve it in your browser
  10. Question 10 · hard

    Show the 3 most expensive products, priciest first. This query returns the 3 cheapest instead. Fix it.

    Solve it in your browser

These questions are free.

Make a free account to solve them, with instant checking and an AI tutor for hints.

Start free