Skip to content
SDETRole
SDETRole

Count failures per test

beginner GROUP BY Challenge 2 of 13

Your team lead wants a quick list of the tests that fail most often across all builds.

Requirements

  • Return each test case’s title and its number of failed runs as failures.
  • Only include tests that failed at least once.
  • Order by failures (highest first), then by title alphabetically for ties.

Expected output

title | failures Apply SAVE10 coupon | 2 Checkout with saved card | 2 Password reset email | 2 Search by product name | 1

Checks (2)

  • ○Sample data
  • ○New failures change the ranking

Each check builds a fresh database and compares your result with the reference solution's: same number of columns in the same order (names are not checked), and the same rows in the same order.

query.sqlExecutes on SQLite in your browser

Ctrl/⌘ + Enter to check query · your code is saved in this browser

Results

Use Run query to see your rows, then Check query to grade it.

Schema · QA Tracker

SQLite

Loading the database…

“null” marks columns that allow NULL. Foreign keys are not enforced, as in many real test databases.

Type to search across SDETRole.

Full-text search by Pagefind · runs in your browser Open search page →