Database Testing FAQs
Data Base Testing -- Interview Q & A
1) What we normally check for in the Database Testing?
What is Database testing?
What is database testing and what we test in database testing?
Database testing means to check the software database connection and also weather it retrive the desire output by firing so query. Check for data quality, accuracy, reliability through the standard procedure defined by the organization. In DB Testing, basically all the events like Add, Delete, Update, Modify etc... and also we will check for connections.
Database can be tested various ways,
If we are usein SQL server then opne the SQL query analyzer and write the queries to retrieve the data. Then verify whether the expected result is correct or not. IF not the data is not inserted into database.
We can play with queries to insert, update and delete the data from the data base and check in the front end of the application.
IF it is Oracle then open the SQL plus and follow the same procedure. Most of the time we find invalid data.
Same way we can test the stored procedure in sql query analyzer and check the result.
We can play with queries to insert, update and delete the data from the data base and check in the front end of the application.
2) How to test data loading in Data base testing ?
We do the following things while we are involving in Data Load testing.
1. We have know about source data (table(s), columns, data types and Constraints)
2. We have to know about Target data (table(s), columns, data types and Constraints)
3. We have to check the compatibility of Source and Target.
4. We have to open corresponding DTS package in SQL Enterprise Manager and run the DTS package (If you are using SQL Server).
5. Then we should compare the column's data of Source and Target.
6. We have to check the number to rows of Source and Target.
7. Then we have to update the data in Source and see the change is reflecting in Target or not.
8. We have to check about junk character and NULLs.
3) How to check a trigger is fired or not, while doing Database testing?
It can be verified by querying the common audit log where we can able to see the triggers fired.
4) What is way of writing test cases for database testing?
You have to do the following for writing the database test cases.
1. First of all you have to understand the functional requirement of the application thoroughly.
2. Then you have to find out the back end tables used, joined 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.
3. After knowing all these things you have to write the test case with different input values for checking all the paths of SP.
One thing writing test cases for backend testing not like functional testing. You have to use white box testing techniques.
5) How to use SQL queries in WinRunner/QTP ?
In QTP 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.
6) What are the different stages involved in Database Testing ?
verify the data in the database w.r.t front end transactions
verify the constraint (primary key, foreign key ....)
verify the performance of the procedures
verify the triggers (execution of triggers)
verify the transactions (begin, commit, rollback)
7) What steps does a tester take in testing Stored Procedures?
Testing the Stored Procedures is the good one.we are passing the Input parameters and easily get the result(output) fast compare to testing the tough business logic in front end.
In SQL server we r using “exec {procedure Name} input1,input2”
8) How do you test whether the database is updated as and when information is added in the front end? Give me an example?
It depends on what level of testing you are doing. When you want to save something from front end obviously, it has to store somewhere in the database. You will need to find out the relevant tables involved in saving the records. Data mapping from front end to the tables. Then enter the data from front end and save. Go to database, fire queries to get the same date from the back end.
9) 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). 10) How to test a SQL Query in WinRunner? Without using DataBase Check Points?
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");
11) We have 50 records of employee table.
a) I want to find the person who is having 22nd highest salary.
b) i want to delete a person with position number 39 with commission
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)
12) Is a "A fast database retrieval rate" a testable requirement?
No. I do not think so. Since the requirement seems to be ambiguous. The SRS should clearly mention the performance or transaction requirements i.e. It should say like "A DB retrival rate of 5 micro sec".
13) 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.
Most of all, maintain a backup of the previous database.
1) What we normally check for in the Database Testing?
What is Database testing?
What is database testing and what we test in database testing?
Database testing means to check the software database connection and also weather it retrive the desire output by firing so query. Check for data quality, accuracy, reliability through the standard procedure defined by the organization. In DB Testing, basically all the events like Add, Delete, Update, Modify etc... and also we will check for connections.
Database can be tested various ways,
If we are usein SQL server then opne the SQL query analyzer and write the queries to retrieve the data. Then verify whether the expected result is correct or not. IF not the data is not inserted into database.
We can play with queries to insert, update and delete the data from the data base and check in the front end of the application.
IF it is Oracle then open the SQL plus and follow the same procedure. Most of the time we find invalid data.
Same way we can test the stored procedure in sql query analyzer and check the result.
We can play with queries to insert, update and delete the data from the data base and check in the front end of the application.
2) How to test data loading in Data base testing ?
We do the following things while we are involving in Data Load testing.
1. We have know about source data (table(s), columns, data types and Constraints)
2. We have to know about Target data (table(s), columns, data types and Constraints)
3. We have to check the compatibility of Source and Target.
4. We have to open corresponding DTS package in SQL Enterprise Manager and run the DTS package (If you are using SQL Server).
5. Then we should compare the column's data of Source and Target.
6. We have to check the number to rows of Source and Target.
7. Then we have to update the data in Source and see the change is reflecting in Target or not.
8. We have to check about junk character and NULLs.
3) How to check a trigger is fired or not, while doing Database testing?
It can be verified by querying the common audit log where we can able to see the triggers fired.
4) What is way of writing test cases for database testing?
You have to do the following for writing the database test cases.
1. First of all you have to understand the functional requirement of the application thoroughly.
2. Then you have to find out the back end tables used, joined 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.
3. After knowing all these things you have to write the test case with different input values for checking all the paths of SP.
One thing writing test cases for backend testing not like functional testing. You have to use white box testing techniques.
5) How to use SQL queries in WinRunner/QTP ?
In QTP 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.
6) What are the different stages involved in Database Testing ?
verify the data in the database w.r.t front end transactions
verify the constraint (primary key, foreign key ....)
verify the performance of the procedures
verify the triggers (execution of triggers)
verify the transactions (begin, commit, rollback)
7) What steps does a tester take in testing Stored Procedures?
Testing the Stored Procedures is the good one.we are passing the Input parameters and easily get the result(output) fast compare to testing the tough business logic in front end.
In SQL server we r using “exec {procedure Name} input1,input2”
8) How do you test whether the database is updated as and when information is added in the front end? Give me an example?
It depends on what level of testing you are doing. When you want to save something from front end obviously, it has to store somewhere in the database. You will need to find out the relevant tables involved in saving the records. Data mapping from front end to the tables. Then enter the data from front end and save. Go to database, fire queries to get the same date from the back end.
9) 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). 10) How to test a SQL Query in WinRunner? Without using DataBase Check Points?
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");
11) We have 50 records of employee table.
a) I want to find the person who is having 22nd highest salary.
b) i want to delete a person with position number 39 with commission
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)
12) Is a "A fast database retrieval rate" a testable requirement?
No. I do not think so. Since the requirement seems to be ambiguous. The SRS should clearly mention the performance or transaction requirements i.e. It should say like "A DB retrival rate of 5 micro sec".
13) 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.
Most of all, maintain a backup of the previous database.
No comments:
Post a Comment