SoftwareTestPilot

SQL checks for testers

  • SQL for testers
  • intermediate
  • 6 min
  • 2 questions

Testers use SQL to confirm what the UI cannot show: duplicates, orphans and wrong totals. Use the small sample dataset to reason about the results.

Skills practised: GROUP BY / HAVING, JOIN reasoning, Data integrity checks

Sample dataset

orders(id, user_id, total): (1, 10, 500), (2, 10, 300), (3, 11, 200), (4, 12, 0). users(id): 10, 11.

Question 1

Using the sample dataset, how many rows does this return? SELECT o.id FROM orders o LEFT JOIN users u ON u.id = o.user_id WHERE u.id IS NULL;

Question 2

Which query finds users with more than one order?

Which query finds users with more than one order?
0/2 answered

Keep learning