SQL for QA

Use simple SQL to check data, find rows, and spot surprises.

Manual QA Module 5 Lesson 5
11 min read

What you'll learn

  • Read basic SELECT queries.
  • Filter rows with WHERE.
  • Check counts and missing data.

SQL for QA

Use simple SQL to check data, find rows, and spot surprises.

Big Picture

One small picture can make this idea easier to hold.

Useful query

  • Select only needed columns.
  • Filter by date or status.
  • Count rows and compare totals.
  • Find missing or wrong values.

Blind dump

  • Export everything and scroll.
  • Guess the problem by eye.
  • Ignore filters.
  • Use no checks at all.

VerdictA small query is easier to trust. A full dump is noisy and slow.

How It Moves

Short steps make the flow easier to see.

1

Pick the table

Choose the data set that matches the test.

Filter rows

Use WHERE to narrow the data.

Check counts

Compare the number of rows to the expected result.

Spot gaps

Look for missing, duplicate, or odd values.

Step By Step

This is the same idea, stretched across time.

  1. 1

    Open the table

    Find the data that matches your test case.

  2. 2

    Write a small query

    Select only the columns you need.

  3. 3

    Run and compare

    Check the rows against the expected result.

  4. 4

    Report the mismatch

    Save the query and the wrong output.

One Small Model

Think of this like a tiny card you can keep in your pocket.

Query result

5 fields
Table:"orders"
Filter:"status = 'paid'"
Count:"42"
Missing:"2 rows"
Check:"Mismatch"
A QA query often asks one simple question and checks the answer.

Quick Check

Question 1 of 10 correct

What does WHERE do in SQL?

Map It

One more picture helps you see where this lesson matters most.

Query power map

Finding power
High

Tiny and clear

SELECT name FROM users

Best for QA

Filter one order by date

Noisy and slow

Export the full table

Good for totals

Count rows by status

Low
SmallLarge
Query size
Small queries often find bugs faster than giant exports.

Final Quiz

Question 1 of 30 correct

What does SELECT do?