Database testing is not one thing. It is a family of three types. Think of it like inspecting a building. Structural testing checks if the foundation and walls are built correctly. Functional testing checks if doors open, lights turn on, and plumbing works. Non-functional testing checks if the building can handle an earthquake.
| Type | What You Test | Example Question | Who Usually Does It |
|---|---|---|---|
| Structural | Table design, column types, constraints | Does the email column have a UNIQUE constraint? | QA + DBA |
| Functional | Data operations, business logic | Does the transfer trigger update both accounts? | QA Engineer |
| Non-Functional | Speed, security, load handling | Does this query run under 2 seconds with 1M rows? | Performance / Security QA |
In interviews, always mention all three types. Most candidates only talk about functional testing. Mentioning structural and non-functional testing shows depth.
Q: What are the different types of database testing?
A: There are three types. Structural testing verifies the database schema — tables, columns, data types, constraints, and indexes. Functional testing verifies data operations — CRUD, triggers, stored procedures, and transactions. Non-functional testing covers performance (query speed), security (SQL injection, access control), and scalability (behavior under load). A comprehensive test plan covers all three.
Key Point: Database testing has three types: structural (schema), functional (data operations), and non-functional (performance + security).