Complete Course
SQL for Testers
Stop trusting the UI: query a real database to prove what the application actually stored, find the data bugs no interface shows you, and build your own test data.
~4 hours of content
Course Content
11 comprehensive lessons covering everything you need to know
Introduction
Introduction
Course Structure
Learn how the course is organized and make the most of the content.
Introduction
Prerequisites
Systems and knowledge required to complete the course. No SQL background needed.
Introduction
Getting to know the application under test
Meet the blog application, its four tables, and the seed data you will query all course long.
Lesson
Lesson 1Clone and open your first database session
Clone the project, start PostgreSQL in Docker, and run your first two commands at the prompt.
Reading data
Lesson
Lesson 2The shape of a database
Tables, rows, columns, primary and foreign keys, and how to read a schema you did not write.
Lesson
Lesson 3SELECT, WHERE, and ORDER BY
Build the query a tester writes every day, one clause at a time, and see why ORDER BY must be deterministic.
Lesson
Lesson 4Filtering like a tester
IN, BETWEEN, LIKE, and ILIKE, plus the NULL behavior that silently drops rows from a correct-looking query.
Lesson
Lesson 5Joins without fear
Inner versus left join explained by the bugs each one lets you see, and why joins multiply rows.
Answering testing questions
Lesson
Lesson 6Aggregations and GROUP BY
Verify the numbers an application displays with COUNT, GROUP BY, and HAVING, and avoid the counts that lie.
Lesson
Lesson 7Finding data problems
Hunt duplicates, orphans, broken references, and impossible states, using anomalies you create yourself.
Lesson
Lesson 8Verifying the UI against the database
Act in the app, query what persisted, and tell a display bug apart from a data bug.
Lesson
Lesson 9Building and cleaning test data
INSERT, UPDATE, DELETE, and transactions, with the professional norms that keep you out of trouble.
Working professionally
Lesson
Lesson 10Why a query is slow
Indexes, EXPLAIN and EXPLAIN ANALYZE, sequential versus index scans, and the database-side N+1.
Lesson
Lesson 11SQL in automated tests
When a database assertion makes a test sharper, when it makes it brittle, and how to seed from test code.
Bonus & Conclusion
Bonus
Bonus: SQL questions in QA interviews
The SQL questions that actually come up in QA hiring, with worked answers you can run on the blog schema.
Conclusion
Congratulations!
You've completed the SQL for Testers course!