MainMenu

Home Java Overview Maven Tutorials

Important Database Testing Interview questions



Q#1: What is Database testing?

Ans: Database testing/Back-end testing is a process of checking an impact of back-end database operation on front-end web/desktop application. Data base testing is divided into following different categories, Data validity testing: While doing this testing, testers should be having good knowledge of SQL queries. Data Integrity testing: While doing this testing, testers/developers should know referential integrity and different constraints. Database Performance testing: While doing this testing, testers/developers should be good in designing the structure of table. Testing of Procedure, triggers and functions: While doing this testing, testers/developers should be having perfect understanding of testing procedure, triggers and functions.



Q#2: Why database testing is important?

Ans: Although, we all know database is not as like small table, it is a big container of many tables and full of data, delivers data at a time to many web/desktop applications. Database testing process ensures that the correct and unique data (without bug) delivers to the correct location. These bugs may cause some serious issues like; dead-locking, data corruption, poor performance, inconsistency, etc….



Q#3: In the Database Testing process, what do we usually check?

Ans: Database testing requires some in-depth knowledge and more defined plan of approach to test the data of a particular application. In Database Testing process we usually check, The field size validation Check constraints. Indexes are done or not (for performance related issues) Stored procedures The field size defined in the application is matching with that in the db.



Q#4: Can you test database manually, if yes; then how, explain with example?

Ans: It needs observing operation; observe the operations of front-end and its effect on the back-end database. While adding a record (XYZ) from the front-end to the back-end database, manually check the record has been affected on the back-end database or not. Similarly, it will work for delete, update,… etc. For Example: To keep record of students who are giving exam; enter the students detail from front-end system and manually check the effect of this addition on back-end database.



Q#5: How to test database procedures and triggers?

Ans: The process of testing database procedures and triggers requires the knowledge of input parameters, output parameters, and EXEC statement. EXEC statement is helpful in running the procedure and observing the behavior of the tables. Let’s see, how to test database procedures and triggers, First, open the database project that will be displayed in the solution explorer Once the desired project is opened, go to the View menu, click on the database schema, and then open the project folder from schema View menu Right click on the object that has to be tested, and then click on the Create Unit Tests. A dialog box “Create Unit Tests” opens and displays all the folders and objects of the database project and the check box for the selected object is checked. Next, create a new language test project Choose to either insert the unit test in an existing test class or create a new test class and click on OK To configure the project, the Project configuration dialog box appears to configure the test project settings. The process requires database connection and data generation plan. Database connection is for executing test result. At last, configure the project and click on OK.



Q#6: What do you mean by data-driven test?

Ans: Data-driven testing is a term used in the testing process whereas test scripts while execution read test data and/or output values from data files (Data pools, Excel files, ADO objects, CSV files, ODBC sources) instead of reading the same hard-coded values each time. The test helps testers in checking the efficiency of the application in handling various inputs.



Q#7: What is the database trigger, how to verify the trigger is fired or not and can you invoke trigger on demand?

Ans: Database trigger: A trigger is basically a stored procedure used to maintain the integrity of the data present in the database, executes automatically to response to a certain event of a table/view in a database. To verify, the trigger is fired or not; use the query of common audit log will display the trigger of the data table. Triggers can’t be invoked on demand, it invoked when table displays an action (insert, delete & update) defined on that particular table.



Q#8: After entering the data from the front-end application interface, how do you test whether a database in updated or not?

Ans: It is totally depends on the application interface that you are using. These are some following ways, You can verify only from the front-end when application interface shows view functionality of the data you enter. Mainly, Black box test engineers do this functionality verification test in this way. If application interface doesn’t provide view functionality of the data you enter, then you can check for database update by using relevant SQL/Oracle query. Checkpoint function of WinRunner/QTP can also be used to check for database update.



Q#9: How to test the Stored Procedures?

Ans: Test engineer needs to follow some steps to test the Stored Procedures, First Step:- First the test engineer should understand the requirement and also the purpose of a particular Stored Procedure. Second Step:- Next verify whether all the indexes, joins, updates, deletions are precise in comparison with the tables mentioned in the Stored Procedure and also make sure that the Stored Procedure is in common standard format, like; comments, updated by, etc. Third Step:- Then, for different sets of input parameters, verify the procedure calling name, calling parameters, and expected reponses. Fourth Step:- Manually, run the procedure with database client programs like; TOAD, mysql, or Query Analyzer. Fifth Step:- To verify results against expected values; re-run the procedure by giving different parameters. Sixth Step:- Finally, automate the tests with QTP.



Q#10: What are joins and mention different types of joins?

Ans: Join is used to combine two or more than two table and displays as a single set of data. In SQL, the types of joins are, Inner Join Outer Join Left Join Right Join In ORACLE/PLSQL, there are four different types of joins, Inner Join Left-Outer Join Right-Outer Join Full-Outer Join



Q#11: What do you mean by index and explain different types of indexes?

Ans: Index is a database object, created on a column of the table to find data more quickly and efficiently (or we can say; it is used to speed up the searches/queries). Different types of indexes are: B-Tree index Bitmap index Clustered index Covering index Non-unique index Unique index



Q#12: What do you mean by DBMS?

Ans: A database is a structured set of data and a database management system (DBMS) is a computer software applications that create communication network between users, others applications and database to store, modify, and extract information from a database. Famous DBMSs are My SQL, Postgre SQL, Microsoft SQL Server, Oracle, SAP and IBM DB2.



Q#13: What do you mean by DML?

Ans: A data manipulation language (DML) is a member of computer programming language facilitates us to select, insert, delete and update data in a database. DML is basically involved in Structured Query Language (SQL), facilitates users to retrieve and use data in a relational database.



Q#14: What do you mean by DCL commands and explain the types of commands used by DCL?

Ans: Data Control Language (DCL) is a component of SQL, controls the use of data stored in a database. There are two types of DCL Commands, Grant = The command facilitates users to access privilege to database Revoke = Stop permitting users to access the database



Q#15: What do you mean by white box testing and black box testing?

Ans: Black-box testing is a software testing technique to test the functional behavior of an application without getting into its internal structures of an application. Core application’s code/internal structure and programming knowledge is not required for black-box testing, but core knowledge of application functionality is required to test the application. White Box Testing (WBT) is also known as Code-Based Testing or Structural Testing to test the internal structure of an software application. In case of white-box testing, tester should be having good understanding of internal structure of an application as well as good knowledge of programming skills to design test cases and internal structure of an application.



Q#16: Does QTP support SQL queries, how to use SQL queries in QTP?

Ans: Although, QTP doesn’t carry any built-in function for database connectivity, tester uses VBScript language to connect and interact with databases using ADODB objects. ADODB objects are divided into four different properties/methods will help in successfully creating database connection, ------------ Connection: Useful in forming a connection with a Database Command: Useful in executing a SQL command(Queries/Stored Procedures) Fields: Useful in retrieving a particular column from a record set after executing a query/stored Procedure. Recordset: Used to retrieve data from a database



Q#17: Which SQL statements can be used in Database Testing?

Ans: All DDL, DML, DCL, and TCL statements of SQL can be used in database testing, DDL (Data Definition Language): All statements related to this can be used in defining the database structure or schema. Statements: CREATE, ALTER, DROP, TRUNCATE, COMMENT, and RENAME DML (Data Manipulation Language): All statements related to this can be used for managing data within schema objects. Statements: SELECT, INSERT, UPDATE, DELETE, MERGE, CALL, EXPLAIN PLAN, and LOCK TABLE. DCL (Data Control Language): GRANT Statement and REVOKE Statement. TCL (Data Manipulation Language): All statements related to this can be used to manage the changes made by DML statements. Using TCL, statements can be grouped together into logical transactions. Statements: COMMIT, SAVEPOINT, ROLLBACK, and SET TRANSACTION.



Q#18: In database testing, how to do the data load testing?

Ans: 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.



Q#19: Is a “A fast database retrieval rate” a testable requirement?

Ans: No. I don’t think so because the requirement appears to be unclear. The SRS should clearly display the performance or transaction requirements, i.e. It should mention like; “Database retrieval rate of 5 microseconds”.



Q#20: Without involving database checkpoints, how you can test a SQL Query in QTP?

Ans: The given below script procedure help us in connecting to the database where we can test both; the database and queries. 1) The script procedure for database connection, db_connect(“query1”,DRIVER={driver name};SERVER=server_name; UID=uidname;PWD=password;DBQ=database_name “); 2) The script procedure to execute the query, db_excecute_query(“query1″,”write query u want to execute”); -Condition to be mentioned- 3) The script procedure to disconnect the connection with database, db_disconnect(“query”);



Q#21: In database testing, what all things are required for writing good test cases?

Ans: 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 collection 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.



Q#22: What is retesting & how it is different from data driven testing?

Ans: 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.



Q#23: What are the types of data driven testing?

Ans: There are four types of data driven testing, Dynamic test data submission through keyboard (key driven test) Data Driven Tests via flat files ( .txt, .doc) Data Driven Tests via front-end objects Data Driven Tests via excel sheet Dynamic test data submission through keyboard (key driven test): In some cases, testers retest a particular application with different input values to validate the calculation via dynamic submission. So, to submit the input value, testers can use the following function in TSL; script– create_input_dialog (“label”); Data Driven Tests via flat files (.txt,.doc):In some cases, testers do the re-testing by considering the data of the flat file. Testers gather those flat files from old databases/customers. Data Driven Tests via front-end objects: In some cases, testers create automation scripts by considering the front-end objects values, such as; (a) list (b) menu (c) table (d) data window (e) ocx etc. Data Driven Tests via excel sheet: In some cases, testers take the help of this data driven test to run 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#24: How to write a query to get the second largest value from a given column of a table?

Ans: This is a query to get the second largest value from a given column of a table, SELECT MAX(COLUMN_NAME) FROM TABLE_NAME WHERE COLUMN_NAME < (SELECT MAX(COLUMN_NAME) FROM TABLE_NAME) For Example:- To get the second largest marks from “Marks” column of a “Students” table Select Max(Marks) from Students Where Marks< (Select Max(Marks) from students)



Q#25: How to write a query to get 10thhighest salary from an employee table?

Ans: This is a query to get nth highest salary from an employee table, SELECT * FROM Employee Emp1 WHERE ( n ) = ( SELECT COUNT( DISTINCT ( Emp2.Employee_Salary ) ) FROM Employee Emp2 WHERE Emp2.Employee_Salary >= Emp1.Employee_Salary ) Here, you can replace the n with any number. For example, if you want to get10th highest salary, then replace n with 10. SELECT * FROM Employee Emp1 WHERE (10) = ( SELECT COUNT( DISTINCT ( Emp2.Employee_Salary ) ) FROM Employee Emp2 WHERE Emp2.Employee_Salary >= Emp1.Employee_Salary )



Q#26: How to write test cases from requirements, do the requirements signify the exact functionality of AUT?

Ans: 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.



Q#27: What is the test scenario to test a database migrated from one SQL Server to another?

Ans: 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.



Q#28: What does the RDBMS stands for and what are the major RDBMS used by SQL?

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



Q#29: What is performance testing and the bottlenecks of it?

Ans: 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.



Q#30: What is CMMI and describe different levels of CMM?

Ans: 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.



Q#31: What is the meaning of Record in a database?

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



: Q#1. What does SQL stand for?

Ans. SQL stands for Structured Query Language.

: Q#2. How to select all records from the table?

Ans. To select all the records from the table we need to use following syntax: Select * from table_name;

: Q#3. Define join and name different type of joins?

Ans. Join keyword is used to fetch data from related two or more tables. It returns rows where there is at least one match in both the tables included in join. Read more here. Type of joins are- Right Join Outer Join Full Join Cross Join Self Join.

: Q#4. What is the syntax to add record to a table?

Ans. To add record in a table INSERT syntax is used. Ex: INSERT into table_name VALUES (value1, value2..);

: Q#5. How do you add a column to a table?

Ans. To add another column in the table following command has been used. ALTER TABLE table_name ADD (column_name);

: Q#6. Define SQL Delete statement.? Ans. Delete is used to delete a row or rows from a table based on the specified condition. Basic syntax is as follows: DELETE FROM table_name WHERE

: Q#7. Define COMMIT ?

Ans. COMMIT saves all changes made by DML statements.

: Q#8. What is a primary key?

Ans. A Primary key is column whose values uniquely identify every row in a table. Primary key values can never be reused.

: Q#9. What are foreign keys?

Ans. When a one table’s primary key field is added to related tables in order to create the common field which relates the two tables, it called a foreign key in other tables. Foreign Key constraints enforce referential integrity.

: Q#10. What is CHECK Constraint?

Ans. A CHECK constraint is used to limit the values or type of data that can be stored in a column. They are used to enforce domain integrity.

: Q#11. Is it possible for a table to have more than one foreign key?

Ans. Yes, a table can have many foreign keys and only one primary key.

: Q#12. What are the possible values for BOOLEAN data field. ? Ans. For a BOOLEAN data field two values are possible: -1(true) and 0(false).

: Q#13. What is a stored procedure?

Ans. A stored procedure is a set of SQL queries which can take input and send back output.

: Q#14. What is identity in SQL?

Ans. An identity column in the SQL automatically generates numeric values. We can defined a start and increment value of identity column.

: Q#15. What is Normalization?

Ans. The process of table design to minimize the data redundancy is called normalization. We need to divide a database into two or more table and define relationships between them.

: Q#16. What is Trigger?

Ans. Trigger allows us to execute a batch of SQL code when a table event occurs (Insert, update or delete command executed against a specific table)

: Q#17. How to select random rows from a table?

Ans. Using SAMPLE clause we can select random rows. Example: SELECT * FROM table_name SAMPLE(10);

: Q#18. Which TCP/IP port does SQL Server run?

Ans. By default SQL Server runs on port 1433.

: Q#19. Write a SQL SELECT query that only returns each name only once from a table?

Ans. To get the each name only once, we need to use the DISTINCT keyword. SELECT DISTINCT name FROM table_name;

: Q#20. Explain DML and DDL?

Ans. DML stands for Data Manipulation Language. INSERT, UPDATE and DELETE are DML statements. DDL stands for Data Definition Language. CREATE ,ALTER, DROP, RENAME are DDL statements.

: Q#21. Can we rename a column in the output of SQL query?

Ans. Yes using the following syntax we can do this. SELECT column_name AS new_name FROM table_name;

: Q#22. Give the order of SQL SELECT ?

Ans. Order of SQL SELECT clauses is: SELECT, FROM, WHERE, GROUP BY, HAVING, ORDER BY. Only the SELECT and FROM clause are mandatory.

: Q#23. Suppose a Student column has two columns, Name and Marks. How to get name and marks of top three students.? Ans. SELECT Name, Marks FROM Student s1 where 3 <= (SELECT COUNT(*) FROM Students s2 WHERE s1.marks = s2.marks)

Database Testing Interview Question.

SQL query interview question.

backend testing interview question and answer.

database interview questions for testers.

: Q#24. What is SQL comments?

Ans. SQL comments can be put by two consecutive hyphens (–).

: Q#25. Difference between TRUNCATE, DELETE and DROP commands?

Ans. DELETE removes some or all rows from a table based on the condition. It can be rolled back. ------------ TRUNCATE removes ALL rows from a table by de-allocating the memory pages. The operation cannot be rolled back DROP command removes a table from the database completely.

: Q#26. What are the properties of a transaction?

Ans. Generally these properties are referred as ACID properties. They are: Atomicity Consistency Isolation Durability.

: Q#27. What do you mean by ROWID ?

Ans. It’s a 18 character long pseudo column attached with each row of a table.

: Q#28. Define UNION, MINUS, UNION ALL, INTERSECT ?

Ans. MINUS – returns all distinct rows selected by the first query but not by the second. UNION – returns all distinct rows selected by either query UNION ALL – returns all rows selected by either query, including all duplicates. INTERSECT – returns all distinct rows selected by both queries.

: Q#29. What is a transaction?

Ans. A transaction is a sequence of code that runs against a database. It takes database from one consistent state to another.

: Q#30. What is difference between UNIQUE and PRIMARY KEY constraints?

Ans. A table can have only one PRIMARY KEY whereas there can be any number of UNIQUE keys. Primary key cannot contain Null values whereas Unique key can contain Null values.

: Q#31. What is a composite primary key?

Ans. Primary key created on more than one column is called composite primary key.

: Q#32. What is an Index ?

Ans. An Index is an special structure associated with a table speed up the performance of queries. Index can be created on one or more columns of a table.

: Q#33. What is the Subquery ?

Ans. A Subquery is sub set of select statements whose return values are used in filtering conditions of the main query.

: Q#34. What do you mean by query optimization?

Ans. Query optimization is a process in which database system compares different query strategies and select the query with the least cost.

: Q#35. What is Collation?

Ans. Set of rules that defines how data is stored, how case sensitivity and Kana character can be treated etc.

: Q#36. What is Referential Integrity?

Ans. Set of rules that restrict the values of one or more columns of the tables based on the values of primary key or unique key of the referenced table.

: Q#37. What is Case Function?

Ans. Case facilitates if-then-else type of logic in SQL. It evaluates a list of conditions and returns one of multiple possible result expressions.

: Q#38. Define a temp table?

Ans. A temp table is a temporary storage structure to store the data temporarily.

: Q#39. How we can avoid duplicating records in a query?

Ans. By using DISTINCT keyword duplicating records in a query can be avoided.

: Q#40. Explain the difference between Rename and Alias?

Ans. Rename is a permanent name given to a table or column whereas Alias is a temporary name given to a table or column.

: Q#41. What is a View?

Ans. A view is a virtual table which contains data from one or more tables. Views restrict data access of table by selecting only required values and make complex queries easy.

: Q#42. What are the advantages of Views?

Ans. Advantages of Views: Views restrict access to the data because the view can display selective columns from the table. Views can be used to make simple queries to retrieve the results of complicated queries. For example, views can be used to query information from multiple tables without the user knowing.

: Q#43. List the various privileges that a user can grant to another user?

Ans. SELECT, CONNECT, RESOURCES.

: Q#44. What is schema?

Ans. A schema is collection of database objects of a User.

: Q#45. What is Table ?

Ans. A table is the basic unit of data storage in the database management system. Table data is stored in rows and columns.

: Q#46. Do View contain Data?

Ans. No, Views are virtual structure.

: Q#47. Can a View based on another View?

Ans. Yes, A View is based on another View.

: Q#48. What is difference between Having clause and Where clause?

Ans. Both specify a search condition but Having clause is used only with the SELECT statement and typically used with GROUP BY clause. If GROUP BY clause is not used then Having behaves like WHERE clause only.

: Q#49. What is difference between Local and Global temporary table?

Ans. If defined in inside a compound statement a local temporary table exists only for the duration of that statement but a global temporary table exists permanently in the db but its rows disappears when the connection is closed.

Database Testing Interview Question.

SQL query interview question.

backend testing interview question and answer.

database interview questions for testers.

: Q#50. What is CTE?

Ans. A CTE or common table expression is an expression which contains temporary result set which is defined in a SQL statement.



1 :What do you understand by DB testing?
Database testing includes performing the data validity, data Integrity testing, performance check related to database and testing of Procedures, triggers and functions in the database.



2 :Why do we need to perform database testing?
There are multiple reasons why database testing is performed. There is a need to perform data integrity, validation and data consistency check on database as the backend system is responsible to store the data and is accessed for multiple purpose. Some of the common reasons why one needs to perform Database testing are as follows − To ease the complexity of calls to database backend, developers increase the use of View and Stored Procedures. These Stored procedures and Views contain critical tasks such as inserting customer details (name, contact information, etc.) and sales data. These tasks need to be tested at several levels. Black box testing performed on front-end is important, but makes it difficult to isolate the problem. Testing at the backend system increases the robustness of the data. That is why database testing is performed on back end system. In a database, data comes from multiple applications and there is a possibility that harmful or incorrect data is stored in the database. Therefore, there is a need to check database components regularly. In addition, data integrity and consistency should be checked regularly.



3 :What are the different steps involved in Database Testing?
The steps that you need to follow while performing database testing are as follows − The data that is being in the database must be verified. Verify if the constraints are maintained. The performance of the procedures and execution of triggers must be checked. Roll back and commit of transaction must be checked.



4 :What are the different categories of DB testing?
Explain. On the basis of function and structure of a database, DB testing can be categorized into the following categories − Structural Database testing − It deals with table and column testing, schema testing, stored procedures and views testing, checking triggers, etc. Functional Testing − It involves checking functionality of database from user point of view. Most common type of Functional testing are White box and black box testing. Nonfunctional Testing − It involves load testing, risk testing in database, stress testing, minimum system requirement, and deals wot performance of the database.



5 :Name a few tools that can be used to test Stored Procedures in a database. The most common tools that are used to perform stored procedures testing are LINQ, SP Test tool, etc.



6 :What is a join in SQL?
What are the different types of joins?
Joins are used to connect two or more tables in some logical manner. Common types of joins include: Inner join, Non-equijoin, Outer join, Self-join, and Cross join.



7 :What is a self-join in SQL?
You can join a single table to itself. In this case, you are using the same table twice.



8 :How can you test an SQL Query in WinRunner?
Step 1 − Connect to the database db_connect(query1 DRIVER {drivername};SERVER server_name;UID uidname; PWD password;DBQ database_name ); Step 2 − Execute the query of the database − db_excecute_query (write the required query that is to execute); Specify the appropriate condition Step 3 − Disconnect the database connection by using db_disconnect(query); Using Output database checkpoints, SQL manual queries options must be selected. Here, the select query can be written.



9 :Explain the steps to test a Stored Procedures in database. First, check the requirement of the stored procedure. The next step is to check if indexes, joins, deletions, update are correct in comparison with tables mentioned in stored procedure. Next, perform the following tasks − Validate the calling procedure name, calling parameters and expected responses for different sets of input parameters. Execute the procedure with TOAD or MySQL or Query Analyzer. Re-execute the available procedures by sending different parameters, and check the results against expected values. Concluding to the process, automate the tests with WinRunner. The tester should call the stored procedure in the database using the EXEC command. If any parameters are required, they must be passed. Different values of parameters must be passed to confirm if the stored procedure is executed or not. On calling this command it must check and verify the nature and behavior of the database. Example − If the stored procedure is written to populate some table, the table values must be checked.



10 :What are the different types of SQL statements?
We have three types of SQL statements − Data Manipulation Language (DML) Data Definition Language (DDL) Data Control Language (DCL)



11 :What are DDL statements in SQL?
DDL statements are used to define the database structure or schema. Some examples − CREATE − to create objects in the database ALTER − alters the structure of the database DROP − delete objects from the database



12 :What is an Operator in SQL?
How many types of operators are there in SQL?
Operators are used to specify conditions in an SQL statement and to serve as conjunctions for multiple conditions in a statement. Arithmetic Operators Comparison/Relational Operators Logical Operators Set Operators Operators used to negate conditions



13 :What is the function of Union operator?
What type of operator is this?
Union is used to combine the results of two or more Select statements. However it will eliminate the duplicate rows. Union is a set operator.



14 :What is the difference between Union and Union All?
Union is used to combine the results of two or more Select statements. However it will eliminate duplicate rows Union All operation is similar to Union, but it also shows the duplicate rows.



15 :What is a trigger?
How to check if a trigger is fired or not?
Triggers are used to maintain the Integrity of database. To check Trigger is fired or not you can check in audit logs.



16 :How to invoke a trigger on demand?
Triggers can’t be invoked on demand. They are invoked when an associated action (insert, delete & update) happens on the table on which they are defined. Triggers are used to apply business rules, auditing and also for the referential integrity checks.



17 :How do you write test-cases for Database testing?
First, get the functional requirement. Then, understand the table structure, Joins, Cursors and Triggers, Stored procedure used, and other parameters. Next, you can write a test-case with different values as input to these objects.



18 :How DB testing is different from Front-end testing?
DB testing involves testing of back-end components which are not visible to users. It includes database components and DBMS systems such as MySQL and Oracle. Front-end testing involves checking functionalities of an application and its components like forms, graphs, menus, reports, etc. These components are created using front-end development tools like VB.net, C#, Delphi, etc.



19 :Explain the process of database testing. The process to perform database testing is similar to testing of other applications. DB testing can be described with the following key processes − Setting up the environment Run a test Check the test result Validating according to the expected results Report the findings to the respective stakeholders



Database Testing Interview Question.

SQL query interview question.

backend testing interview question and answer.

database interview questions for testers.

20 :Which SQL statements are commonly used to develop test-cases for database testing?
Various SQL statements are used to develop the Test cases. Most common SQL statement which is used to perform DB testing is select statement. Apart from this various DDL, DML, DCL statements can also be used. Example − Create, Insert, Select, Update, etc.



21 :What is a View in database?
How is it related to data independence?
A view is a table that does not really exist in its own right but is instead derived from one or more base table. In other words, there is no stored file that direct represents the view instead a definition of view is stored in data dictionary. Growth and restructuring of base tables is not reflected in views. Thus the view can insulate users from the changes in the database. Hence accounts for logical data independence.



22 :What is VDL (View Definition Language)?
It specifies user views and their mappings to the conceptual schema.



23 :What is normalization?
It is a process of decomposing a table into multiple tables without losing any information. Normalization is done to achieve the following goals − To minimize redundancy. To minimize insertion, deletion and update anomalies.



24 :What is indexing and what are the different kinds of indexing?
Indexing is a technique for determining how quickly specific data can be found. It is used for query performance optimization. Indexing can be of the following types − Binary search style indexing B-Tree indexing Inverted list indexing Memory resident table Table indexing



25 :Define SQL and how is it different from other conventional programming Languages?
SQL is a Structured Query language that is designed specifically for data access operations on normalized relational database structures. The primary difference between SQL and other conventional programming languages is that SQL statements specify what data operations should be performed rather than how to perform them.



26 :What are stored procedures?
What are the advantages of using them?
Stored procedures are used to perform a user defined operation. A stored procedure can have a set of compound SQL statements. A stored procedure executes the SQL commands and returns the result to the client.



27 :What are cursors in PL/SQL?
PL/SQL uses cursors for all database information accesses statements. The language supports the use two types of cursors − implicit and explicit.



28 :In Oracle, what is cold backup and hot backup?
Cold Backup − Cold back is known as taking back up of database files, redo logs, and control file when the instance is shut down. This is a file copy, usually from the disk directly to tape. You must shut down the instance to guarantee a consistent copy. If a cold backup is performed, the only option available in the event of data file loss is restoring all the files from the latest backup. All the changes that are performed after the last backup is lost. Hot Backup − Some databases can’t shut down while making a backup copy of the files, so cold backup is not an available option. For these types of database we use hot backup.



29 :What is an SQL subquery?
SQL subquery is a means of querying two or more tables at the same time. The subquery itself is an SQL SELECT statement contained within the WHERE clause of another SQL SELECT statement, and separated by being enclosed in parenthesis. Some subqueries have equivalent SQL join structures, but correlated subqueries cannot be duplicated by a join



30 :You have been provided with a set of tables and asked to create a new database to store them. While checking the data values in the tables, what points to be considered for this?
In such a case, you need to test the following aspects − Multivalued dependencies Functional dependencies Candidate keys Primary keys Foreign keys



31 :How do you test if your database is updated when data is entered in front-end application?
You can go to the database and run a relevant SQL query. In WinRunner, you can use database checkpoint function. If the application provides view function, then you can verify the same from the front-end.



32 :What is data-driven testing?
Data-driven testing is defined as 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 values manually from front-end interface.



33 :What is retesting and how it is different from data driven testing?
Once you execute the test-cases and find the defects 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. Retesting is also called Data Driven Testing with a small difference − Retesting − It is a manual testing process whereas application testing done with entire new set of data. Data-driven Testing − 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 values manually from front-end interface.



34 :What are the types of data driven testing?
There are four types of data driven testing − Dynamic test data submission through keyboard Data Driven Tests via .txt, .doc flat files Data Driven Tests via front-end objects Data Driven Tests via excel sheet



35 :What is performance testing?
Performance testing is a software testing technique to determine how a system performs in terms of speed, sensitivity and stability under a heavy workload.



36 :What are the key points that should be considered while performing database recovery testing?
The following key points are to be considered while performing database recovery testing − Time span when changes or modifications occurs in database system. The period by which you want your recovery plan conducted. The sensitivity of data in database system. More critical the data is, the more regularly you will need to test the software.



37 :Name a few tools that are used by a tester to generate test data for a database system. The following tools are used to generate test data − Data Factory DTM Data Generator Turbo Data



38 :What are the common types of data backups?
There are two types of backup that can be used − Physical Backups − Physical backup includes taking back up using 3rd party backup tools like Veritas net back, IBM Tivoli Manager or user manager backups using OS utilities. Logical Backups − Logical backup of database includes taking back up of logical objects like tables, indexes, procedures, etc. A common tool to take data backup is Oracle Recovery Manager (RMAN) that is an Oracle utility to take database backup.



39 :Name the common actions performed in Database recovery testing?
The following actions are performed in database recovery testing − Testing of database system Testing of the SQL files Testing of partial files Testing of data backup Testing of Backup tool Testing log backups



40 :What do you understand by database security testing?
Database security testing is performed to find the loop holes in security mechanisms and also about finding the vulnerabilities or weaknesses of database system.



41 :Name a few objectives of Database security testing. Database security testing is performed to check the following aspects − Authentication Authorization Confidentiality Availability Integrity Resilience



42 :What is SQL Injection threat?
SQL Injection threat is the most common type of attack in a database system where malicious SQL statements are inserted in database system and executed to get critical information from database system. This attack takes advantage of loopholes in implementation of user applications. To prevent this user inputs fields should be carefully handled.



43 :Name a few tools that can be used to perform database security testing?
The following tools can be used to perform database security testing: Zed Attack Proxy, Paros, Social Engineer Toolkit, Skipfish, Vega, Wapiti, and Web Scarab.



44 :What are the common challenges that you face while performing database testing?
The common challenges that one faces while performing database testing are as follows − Testing scope is too large Scaled-down test database Changes in database structure Complex Test Plans Good understanding of SQL









No comments:

Post a Comment