InterviewSolution
This section includes InterviewSolutions, each offering curated multiple-choice questions to sharpen your knowledge and support exam preparation. Choose a topic below to get started.
| 1. |
What are the differences between GUI Testing and Database Testing? |
||||||||||||
Answer»
The need for correct data has grown exponentially in the software development field. It is very crucial to use the right data, perform the right set of OPERATIONS on it and show the results to the right set of people. Due to this, database testing helps to validate the correctness, integrity and truthfulness of the data. In this article, we have seen the most commonly asked questions in database testing that deals with RDBMS database systems to both freshers and experienced people. Useful RESOURCES: DBMS Interview SQL Interview MYSQL Interview |
|||||||||||||
| 2. |
How will you fetch the values from TableA that are not present in TableB without using the NOT keyword? |
||||||||
Answer»
We can do it EASILY by USING the SELECT and EXCEPT keywords as SHOWN below: SELECT * FROM TableA EXCEPT SELECT * FROM TableB; |
|||||||||
| 3. |
Is it possible to have multiple primary keys in a table? |
|
Answer» No. A table can allow one COMPOSITE primary KEY that CONSISTS of TWO or more columns. But it does not allow for multiple primary KEYS. |
|
| 4. |
How do you check for an error in a stored procedure consisting of 1000s of lines of code? |
|
Answer» We can test using the following methods: |
|
| 5. |
How can you validate the tables and columns in the database? |
|
Answer» We can test the tables and COLUMNS in the databases by applying the following test cases:
|
|
| 6. |
What are the best practices that need to be followed while performing database testing? |
|
Answer» Following are some good practices that need to be followed while performing database testing:
|
|
| 7. |
What are the most commonly occurring issues that are faced during database testing and how can they be solved? |
Answer»
|
|
| 8. |
How can you test the data integrity in database testing? |
|
Answer» Whenever there are different modules in the application that are using the same DATA and also perform different operations on them, it is very much necessary to have the latest data to be shown everywhere. The most recent value of the data should be used by the systems. This is called Data Integrity. Following image shows 5 characteristics of data following data integrity: We can apply the following test cases for TESTING out the integrity of the data:
|
|
| 9. |
How can you validate the ACID properties? Explain with an example. |
|
Answer» Consider a simple SQL CODE below: CREATE TABLE ACID_DEMO (X INTEGER, Y INTEGER, CHECK (X + Y = 50));We will test for the ACID properties for two columns X and Y. There is also a constraint added on the table that the sum of values in columns X and Y should always be 50.
|
|
| 10. |
How can you test Transactions in SQL Databases? |
|
Answer» Transactions require the ACID properties to be satisfied. To achieve that, we use the below statements: BEGIN TRANSACTION TRANSACTION#END TRANSACTION TRANSACTION#ROLLBACK TRANSACTION#The Rollback command ENSURES that the database changes are ROLLED back to the previous stable commit and ensures consistency. Once the transactions are executed, we can make use of SELECT queries to RUN on the tables where the transaction took place and validate the data. |
|
| 11. |
How will you perform data load testing? |
|
Answer» Data load testing requires the testers to know about source databases and the destination databases and their objects like tables, columns, design, constraints etc. While performing tests, we need to validate the compatibility of the source and destination databases using the DTS package in SQL Enterprise Manager. We can follow the below steps for the same:
|
|
| 12. |
Why are SQL constraints used in a database? |
|
Answer» SQL Constraints are used for setting the rules for the records in the database table. If any constraints are not satisfied, then the action can be aborted. The constraints are defined when we create the database objects. It can also be ALTERED by using the ALTER commands. SQL has 6 major constraints, they are:
|
|
| 13. |
What are the possible test scenarios that need to be tested when a database gets migrated from one SQL server to another? |
|
Answer» Firstly, when migration happens, we need to be aware of all the changes and enhancements are done in the new SQL server. Based on this information, design your test case SUITE by considering the FOLLOWING points:
|
|
| 14. |
How do you test the database triggers and procedures? |
|
Answer» For testing the database triggers and procedures, it is required to KNOW the input parameters to these functionalities and know what would be the expected output for these. The EXEC statement can be used for determining the behaviour of the TABLES when the procedures or triggers are run. You can also achieve this by creating SQL unit tests for checking the database objects modified due to the EXECUTION of the triggers or procedures. The SQL unit tests follow the 3 rules as shown below: The test case should check whether the objects exist in the database or not. It should check or validate what the normal outputs would be for success scenarios. It should also check for the behaviour of the system under the influence of NEGATIVE test cases. |
|
| 15. |
What is structural database testing? |
|
Answer» This testing involves testing database structures that DEPEND on schema, tables, triggers, functions, procedures and also the servers USED for databases. Following are the types of structural testing:
|
|
| 16. |
Write the step-by-step process to test the database? |
|
Answer» The process to perform database testing is very similar to the steps that we follow for testing any other applications. FOLLOWING are the steps that are followed:
|
|
| 17. |
Why do you think database testing is important in the field of software testing? |
|
Answer» Database testing ensures that the data in the database that is received from various sources are correct and as per the business requirements or not. It helps to analyse the risks associated with incorrect data, PROTECT from data losses due to incorrect transactions and also properly check for unauthorized access to the data. In most of the applications, the User Interface is GIVEN the most importance while testing to validate the correctness of the data. But in cases where there is a lack of UI or view, it is very much essential to test the quality of the INFORMATION in the database. Consider the example of a banking application where lots of users use it to perform transactions. While testing the database, it is very much important to NOTE the following points:
To perform these validations, it is very much needed to possess the art of data testing or database testing. |
|