Top 32 Database Testing Interview Questions You Must Prepare 06.Dec.2023

Following steps need to follow to test data loading

  • Source data should be known
  • Target data should be known
  • Compatibility of source and target should be checked
  • In SQL Enterprise manager, run the DTS package after opening the corresponding DTS package
  • You have to compare the columns of target and data source
  • Number of rows of target and source should be checked
  • After updating data in the source, check whether the changes appears in the target or not.
  • Check NULLs and junk characters

DCL stands for Data Control Language, it is used to control data.
The two types of DCL Commands are:
Grant: By using this command user can access privilege to database
Revoke: By using this command user cannot access the database

The statements like SELECT, INSERT, UPDATE, DELETE are used to manipulate the table, while ALTER TABLE, CREATE TABLE and DELETE TABLE are used to manage table.

Normally, the things that we check in database testing are:

  • Constraint Check
  • Validation of a Field size
  • Stored procedure
  • Matching application field size to database
  • Indexes for performance based issues

Writing a testcases is like functional testing. First you have to know the functional requirement of the application. Then you have to decide the parameters for writing testcases like

  • Objective: Write the objective that you would like to test
  • Input method: Write the method of action or input you want to execute
  • Expected: how it should appear in the database

Knowledge of following things is required before writing the database test cases:

  • At first, understand the application completely and functional requirement of the application.
  • Second, check-out other entities that have been used in an application; back-end database tables, joins between the tables, cursors (if any), triggers (if any), stored procedures (if any), input parameter and output parameters for developing that requirement.
  • After collecting all necessary information, write down the test case with different input values for examining all the resources.
  • Writing test cases for back end testing is opposite to functional testing, one should use the white box testing technique.

RDBMS stands for Relational Database Management Systems that use SQL, and the important RDBMS that SQL uses are Sybase, Oracle, Access ,Ingres, Microsoft SQL server etc.

In a data-table, to test the multi numbers of data, data-driven test is used. By using this it can easily replace the parameters at the same time from different locations.

After execution of the test in terms of finding the defect that has been already detected and fixed. Re-execution of the same test with different input values to confirm the original defect has been successfully removed is called Re-testing or confirmation Testing.

Retesting is also called Data Driven Testing, but the difference between both is,

Retesting:- It is a manual testing process whereas application testing done with entire new set of data.

DataDriven Testing(DDT):-It is an Automation testing process where application will be tested with multiple test data.It is simple and easy than retesting where tester just sit in front of system and enter different new input valuesmanually from front-end interface, it is really boring technique.

Black box testing me testing the software for the outputs on giving particular inputs. This testing is usually performed to see if the software meets the user's requirements. There is no specific functional output expected for running this test.

The white box testing is done to check the accuracy of code and logic of the program. This testing is done by the programmer who knows the logical flow of the system.

For data load testing:

  • You need to have knowledge about source database (data tables, columns, associated constraints, data types) and destination database (data tables, columns, data types, and constraints).
  • You need to check the compatibility between source database and destination database via the DTS package.
  • You need to Open corresponding DTS package in SQL Enterprise Manager and run the DTS package (If you are using SQL Server).
  • Then you need to compare the column’s data of Source and the Target.
  • You have to check the number to rows of Source and Target.
  • After updating data in the Source database, you need to check whether the changes have been reflected on destination database or not.
  • You need to check about junk character and NULLs.
  • Database load testing, check the volume of the database server to process the queries, and also check the response time of database server and client.

On querying the common audit log you would know, whether, a trigger is fired or not. It is in audit log where you can see the triggers fired.

Performance testing is a software testing technique to determine that how a system performance in terms of speed, sensitivity and stability under a heavy workload.
The performance testing requires expensive tools and well-trained and experienced testers for operation.

Data base testing is segmented into four different categories.

  • Testing of Data Integrity
  • Testing of Data Validity
  • Data base related performance
  • Testing of functions, procedure and triggers

In database, a record is the set of values/fields of a specific entity.
For example; Office_Employee Record, Book Record etc.

To measure the system response, load testing is done. If the load exceeds the users pattern it is known as stress testing. Examples of load testing are downloading the set of large files, executing multiple applications on a single computer, subjecting a server to large number of e-mails and allotting many tasks to a printer one after another.

The tester will check the standard format of the stored procedures and also it checks the fields are correct like updates, joins, indexes, deletions as mentioned in the stored procedure.

Once the testing is done, QTP will generate a report. This report will show the checkpoints, system message and error that were detected while testing. The test results window will show any mismatches encountered at the checkpoints.

RDBMS stands for Relational Database Management Systems. Major RDBMS that are involved with SQL are Sybase, Oracle, Access, Ingres, Microsoft SQL server etc.

Indexes are database objects and they are created on columns. To fetch data quickly they are frequently accessed. Different types of indexes are:

  • B-Tree index
  • Bitmap index
  • Clustered index
  • Covering index
  • Non-unique index
  • Unique index

Yes, the requirements should signify the exact functionality of AUT.

To do so:

  • First examine the requirement to understand overall functionality.
  • Next, decide which test design methods are suitable to write test case – Black Box test design methods like; Equivalence Partitioning, Boundary Value Analysis, Error Guessing and Cause Effect Graphing.
  • Once you decide which test design method is suitable, write your test cases in requirement analysis and design phase. In this way you will be ensure that all the requirements are testable.

To define database structure, DDL is used. DDL stands for Data Definition Language. The various DDL commands include Create, Truncate, Drop, Alter, Comment and Rename.

To write a testcases from requirements, you need to analyse the requirements thoroughly in terms of functionality. Thereafter you think about the appropriate testcases design techniques like Equivalence partitioning, Black box design, Cause effect graphing etc. for writing the testcases.Yes, the requirements represent exact functionality of AUT.

To test database procedures and triggers, input and output parameters must be known. EXEC statement can be used to run the procedure and examine the behaviour of the tables.

  • Open the database project in solution explorer
  • Now in View menu, click the database schema
  • Open the project folder from schema View menu
  • Right click on the object that has to be tested, and then click on the dialog box that says Create Unit Tests
  • After that create a new language test project
  • Select either a) Insert the unit test or b) Create a new test and then click OK
  • Project that has to be configured will be done by clicking on the Project Configuration dialog box.
  • Once it configured click on OK

First of all, we need to check what all enhancements and changes happened to the SQL Server where we are planning to migrate.
Next, design the test case according to the following consideration:

  • Data type that has been used.
  • Length of the data field of SQL Server (Server into which we are migrating the data) should be same as the SQL Server from where we are taking out the data.
  • Each and every task should be organized correctly.

In QTP using output database check point and database check, you have to select the SQL manual queries option. After selecting the manual queries option, enter the "select" queries to fetch the data in the database and then compare the expected and actual.

Testing the database manually involves checking the data at the back end and to see whether the addition of data in front end is affecting the back end or not, and same for delete, update, insert etc.

By writing scripting procedure in VBScript, we can connect to database and can test the queries and database.

Join is used to display two or more than two table and the types of joins are:

  • Natural Join
  • Inner Join
  • Outer Join
  • Cross Join

The outer join is divided again in two:

  • Left outer join
  • Right outer join

Performance testing determines the speed of the computer system performance. It includes the quantitative tests like response time measurement. The problem in performance testing is that you always need a well-trained and experienced man power also the tools you use are expensive.

QTP testing process is based on following steps:
Creating GUI (Graphical User Interface) Map files :

  • Identifies the GUI object which has to be tested
  • Creating test scripts: Test scripts are recorded
  • Debug tests: Test should be debugged
  • Run tests: Testcases should be run.
  • View results: The results reflects the success or failure of the tests
  • Report detects: If the test is failed, the reasons will be recorded in the report detect file

CMMI stands for Capability Maturity Model Integration is a process development training and evaluation model of various business processes in software engineering.

Five CMM Maturity levels for an organization are:

1) Initial: At this level, organizations don’t have any verified technique and environment, so that; usually organizations budget and schedule time go over.
2) Repeatable: At this level, organizations have basic techniques and guidelines to limit the cost and schedule time, capable in repeating the same in the next similar project.
3) Defined: At this level, all techniques are well organized and explained clear and standard form.
4) Managed: At this level, organizations are much more developed than Defined level. Here, techniques are contacted using statistical and other quantitive technique.
5) Optimizing: Organizations determinedly attempt to develop performance via modern technical progress.