🗄 Database Sandbox

A read-only SQL console over a seeded orders dataset with real data-integrity problems baked in. Write SELECTs to prove the data is broken.

DatabaseIntermediate

This console is wired to a separate practice database, opened read-only. It cannot see the site's own tables, and SELECT is the only statement it will run.

⌘/Ctrl + Enter

Challenges

Work through these before revealing anything. Answers are opinions worth arguing with, not gospel.

  1. 01

    Find every order whose customer_id has no matching row in customers (orphaned records).

    sign in to track
  2. 02

    Are there duplicate customer email addresses? There should not be.

    sign in to track
  3. 03

    Find order_items whose line total does not equal quantity × unit_price.

    sign in to track
  4. 04

    Are there any orders with a negative or zero total?

    sign in to track
  5. 05

    Find products that have never been ordered.

    sign in to track
  6. 06

    Which customers have orders dated before their own signup date?

    sign in to track