Sunteți pe pagina 1din 7

Database Testing Interview Questions: Q.

1 to 10

Q. 1: What we normally check for in the Database Testing?
In Database Testing we need to check,
1) The field size validation
2) Check constraints.
3) Indexes are done or not (for performance related issues)
4) Stored procedures
5) The field size defined in the application is matching with that in the db.
<<<<<< =================== >>>>>>
Q. 2: What is Database testing?
Database testing include the following.
1) Data validity testing: For doing data validity testing you should be good in SQL queries.
2) Data Integrity testing: For data integrity testing you should know referential integrity and different
constraints.
3) Performance related to database: For performance related things you should have idea about the
table structure and design.
4) Testing of Procedure triggers and functions: For this a clear understanding of testing procedure
triggers and functions is required.

Database testing is all about testing joins, views, imports and exports, testing the procedures, checking
locks, indexing etc.

Database testing does not refer to testing of the data in the database.
Usually Database administrators perform database testing.

<<<<<< =================== >>>>>>
Q. 3: How can we do manual testing of database? Explain with an example
It involves observing operations that are operated on front-end are effected on the back-end or not. The
approach can be explained like:
While adding a record through the front-end, check back-end that addition of record is effected or not. It
applies to delete, update,......etc.

For Example: Enter the employee record in database through the front-end and check manually if the
record is added or not to the back-end.
<<<<<< =================== >>>>>>
Q. 4: What is data-driven test?
Data driven test is used to test the multi-numbers of data in a data-table. With help of this we can easily
replace the parameters at the same time from different locations e.g.: using .xls sheets.
<<<<<< =================== >>>>>>
Q. 5: While doing database testing, how do we know that a trigger is fired or not?
It can be verified by querying the common audit log where we are able to see if the triggers is fired or not.
<<<<<< =================== >>>>>>
Q. 6: Is a "A fast database retrieval rate" a testable requirement?
No. Since the requirement seems to be ambiguous. The SRS should clearly mention the performance or
transaction requirements i.e. It should specify clearly like - Database retrieval rate of 5 microseconds.
<<<<<< =================== >>>>>>
Q. 7: How to test a DTS package created for data insert update and delete? What should be
considered in the above case while testing it? What conditions are to be checked if the data is
inserted, updated or deleted using a text files?
Data Integrity checks should be performed. IF the database schema is 3rd normal form, then that should
be maintained. Check to see if any of the constraints have thrown an error.
The most important command will have to be the DELETE command. That is where things can go really
wrong.
It is important to maintain a backup of the previous database.
<<<<<< =================== >>>>>>
Q. 8: How to test a SQL Query in QTP or winRunner? Without using database checkpoints?
By writing scripting procedure we can connect to the database and can test the database and queries.
The exact process should be:

1) Connect to the database:
db_connect("query1",DRIVER={drivername};SERVER=server_name;
UID=uidname;PWD=password;DBQ=database_name ");

2) Execute the query:
db_excecute_query("query1","write query u want to execute");
-Condition to be mentioned-
3) Disconnect the connection:
db_disconnect("query");
<<<<<< =================== >>>>>>
Q. 9: How do you test whether a database in updated when information is entered in the front
end?
It depends upon the application interface.
1) If your application provides view functionality for the entered data, then you can verify that from front
end only. This way Black- box test engineers verify the functionality most of the times.
2) If your application has only data entry from front end and there is no view from the front end, then you
have to go to Database and run relevant SQL query.
3) You can also use database checkpoint function in QTP.
<<<<<< =================== >>>>>>
Q. 10: What steps does a tester take in testing Stored Procedures?
First the tester should to go through the requirement, as to why the particular stored procedure is written
for.
Then check whether all the required indexes, joins, updates, deletions are correct comparing with the
tables mentioned in the Stored Procedure. And also he has to ensure whether the Stored Procedure
follows the standard format like comments, updated by, etc.
Then check the procedure calling name, calling parameters, and expected Reponses for different sets of
input parameters.
Then run the procedure yourself with database client programs like TOAD, or mysql, or Query Analyzer
Rerun the procedure with different parameters, and check results against expected values.
Finally, automate the tests with QTP.



Database Testing Interview Questions: Q. 11 to 20

Q. 11: How do we use SQL queries in QTP?
By using output database check point and database check point,
Select SQL manual queries option
And enter the "select" queries to retrieve data in the database and compare the expected and actual
results
<<<<<< =================== >>>>>>
Q. 12: What SQL statements have you used in Database Testing?
The most important statement for database testing is the SELECT statement, which returns data rows
from one or multiple tables that satisfies a given set of criteria.
We can use other DML (Data Manipulation Language) statements like INSERT, UPDATE and DELTE to
manage your test data.
We can use DDL (Data Definition Language) statements like CREATE TABLE, ALTER TABLE, and
DROP TABLE to manage your test tables.
We may need some other commands to view table structures, column definitions, indexes, constraints
and store procedures.
<<<<<< =================== >>>>>>
Q. 13: How to test data loading in Data base testing?
Following steps are necessary for Data Load testing.
1) You need to know about source data (table(s), columns, data types and Constraints)
2) You need to know about Target data (table(s), columns, data types and Constraints)
3) You need to check the compatibility of Source and Target.
4) You need to Open corresponding DTS package in SQL Enterprise Manager and run the DTS package
(If you are using SQL Server).
5) Then you need to compare the column's data of Source and the Target.
6) You have to check the number to rows of Source and Target.
7) Then you need to update the data in Source and see the change is reflecting in Target or not.
8) You have to check about junk character and NULLs.
<<<<<< =================== >>>>>>
Q. 14: What are the pre-requisites for writing test cases for database testing?
Following pre-requisites are necessary before writing the database test cases.
1) First of all we need to understand the related documentation.
2) Understand the functional requirement of the application thoroughly.
3) Then you have to find out the back end tables used, joins used between the tables, cursors used (if
any), triggers used(if any), stored procedures used (if any), input parameter used and output parameters
used for developing that requirement.

4) After knowing all these things you have to write the test case with different input values for checking all
the paths of SP.

<<<<<< =================== >>>>>>
Q. 15: What is retesting & how it is different from data driven testing?
Re-execution of a test with different input values is called Re-testing. To validate the project calculations,
the test engineer follows retesting method through an automation tool.

Retesting is also called Data Driven Testing.

<<<<<< =================== >>>>>>
Q. 16: What are the types of data driven tests?
There are four types of data driven tests.

1) Dynamic Input submission (key driven test): Sometimes a test engineer conducts retesting with
different input values to validate the calculation through dynamic submission. For this input submission,
test engineer uses this function in TSL scriipt-- create_input_dialog ("label");
2) Data Driven Files Through FLAT FILES ( .txt,.doc): Sometimes test engineer conducts re-testing
depending upon the contents of the flat file. He collects these files from Old Version databases or from
customer side.
3) Data Driven Tests From FRONTEND GREAVES: Sometimes a test engineer creates automation
scripts depending upon the front-end objects values such as (a) list (b) menu (c) table (d) data window (e)
ocx etc.,
4) Data Driven Tests From EXCEL SHEET: sometimes a test engineer follows this type of data driven
test to execute the script for multiple inputs. These multiple inputs reside in columns of an excel sheet.
We have to collect this test data from the backend tables.
<<<<<< =================== >>>>>>



Q. 17: Write a query to find the second largest value in a given column of a table
To find the second largest salary amount from employee table
select max(salary) from employees
where pin < (select max(salary) from employees)
Select Max(sal) from Emp where Sal < (select Max(sal) from Emp)
<<<<<< =================== >>>>>>
Q. 18: Now suppose i have 50 records of employee table.
1) I want to find the person who is having 22nd highest salary.
2) I want to delete a person with position number 39 with commission < 100
3) Update record no 45
select emp_id,emp_name, sal from employee a where &n = (select count(distinct(salary)) from employee
b where a.sal <=b.sal)
&n=22 ( U will be asked to enter the number and then enter for which record u want to retrieve)
a.sal <=b.sal (this can be used to retrieve max record)
a.sal >=b.sal( this can be used to retrieve min record)
select min(sal) from (select distinct sal from employee order by sal desc) where rownum<23
<<<<<< =================== >>>>>>
Q. 19: How can we write test cases from Requirements? Do the Requirements represent exact
Functionality of AUT
Yes, Requirements should represent exact functionality of AUT.
First of all you have to analyze the requirement very thoroughly in terms of functionality. Then you have to
think about suitable test case design techniques (Black Box design techniques like Equivalence
Partitioning, Boundary Value Analysis, Error Guessing and Cause Effect Graphing) for writing the test
case.
By these concepts you should write a test case which should have the capability of finding the absence of
defects.
<<<<<< =================== >>>>>>

Q. 20: What are the test scenarios to test a database migrated from SQL Server 2005 to SQL
Server 2008?
We need to check out what was all the enhancement the SQL Server 2008 has in it. We need to design
our test case considering the following points.
1) Data type used
2) Length of the data field it should be same as it was in SQL 2005
3) All the jobs should be scheduled properly

S-ar putea să vă placă și