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
Download the complete Questions Bank
An expert on R&D, Online Training and Publishing. He is M.Tech. (Honours) and is a part of the STG team since inception.
Very nice article and very helpful. Thanks
Valuable & helpful article! Thanks a lot.
Very good article. If any more on database testing, please let me know
Thanks for the valuable questions and answers.