Database Testing PDF
Database Testing PDF
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 mentioned3) 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.
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