SQL (SQLite engine)

Read a query execution plan

Hard120 pts~45 min
  • EXPLAIN QUERY PLAN
  • Join order
Practice app · Acme Commerce DB

A real SQL database (SQLite engine) seeded with an e-commerce and HR dataset, with schema browser and query runner.

Test URL
/lab/database-testing-read-a-query-execution-plan

Your starter code already declares TEST_URL — never hardcode a host.

Objective

Capture the execution plan of the UK-customers order report and identify which table is scanned and which is looked up by key.

Your task

  1. 1Take the report query: SELECT c.name, o.id, o.total FROM customers c JOIN orders o ON o.customer_id = c.id WHERE c.country = 'UK'.
  2. 2Prefix it with EXPLAIN QUERY PLAN and run it as the last statement.
  3. 3Read the detail column: one table is a full SCAN, the other a SEARCH by INTEGER PRIMARY KEY.

Acceptance criteria

  • The last result set is the plan of the report query
  • The script uses EXPLAIN QUERY PLAN

Constraints

  • Only the last result set of your script is compared, so finish with the verification query.

SQL (SQLite engine) · Database Testing · Performance, backup & recovery