Database / SQL Testing Interview Questions
Database testing or sql testing is mostly treated as back end testing where the tester performs a different kind of role here. He will write and execute test cases as usual, but in his test cases he writes the sql queries and the results of sql query in the test case template.
He will manually go to database by using Toad/sql developer or any other database client tool, and then write sql queries to check if the application is giving the same data as required by the user. Basically he will double check the application results by manually writing sql queries.
1. Which SQL statements have you used for testing databases?
This is a basic interview question used to determine your experience with using SQL and databases. Simply provide enough information to adequately display your knowledge of these items.
2. What is used to check data loading during database testing?
Query analyzer can be used to check data loading. 3.
How should test cases be written for database testing?
Test cases for database testing should include the following information: project name, module name, bug ID number, test objective, steps/actions, expected results, actual results, status, priority of defect, and severity of defect.
4. What is typically checked during database testing?
The following items are typically checked during database testing:
- Validation of field size (application matches what resides in database)
- Indexes (associated with performance related issues)
- Stored procedures
5. Provide an example of what can be manually tested in a database.
Non-editable fields through the database can be tested manually. For example, a field that is non-editable through the front end, should not allow a user to add a record to the database.
6. What are the different types of Join conditions in SQL?
Inner join, Outer Join, Left outer join, Right outer join. And try to explain each of them if he gives time.
7. How can you retrieve unique rows from a table?
I can do that by using a DISTINCT keyword in my sql query. eg: select DISTINCT * from products where product_category = ‘Electronics’;
8. How do SQL queries will effect the performance of the application?
Yes, sql queries make a lot of impact on the whole performance of application. A poorly written sql query by a developer can take long time to generate a report or retrieve data from data base. So, we need to take few precautions while writing queries, as a database tester I will also review the queries written by a developer. For example: get rid of nested sql queries as much as possible and make use of joins.
The above are few of many database testing interview questions. I will keep updating this page as and when I get time. please book mark this page (Ctrl + D) in your favorites for quick access. You must also know the important 100 sql query samples and Important SQL interview questions.