Cross_Column

Monday, 29 December 2025

DataBase Testing Interview Questions


Basic Database Testing Interview Questions with Answers

Basic Database Testing Interview Questions with Answers

These database testing interview questions are frequently asked in manual testing, automation testing, and SQL interviews. They cover basic concepts like joins, keys, and constraints.


1. What is a Cross Join?

A Cross Join returns the Cartesian product of two tables. It combines every row from the first table with every row from the second table.


SELECT * FROM Employees CROSS JOIN Departments;

If Table A has 3 rows and Table B has 4 rows, the result will have 12 rows.


2. What is a Self Join?

A Self Join is a join in which a table is joined with itself. It is useful when data in the same table is related.


SELECT A.emp_name, B.emp_name AS manager_name
FROM Employees A
JOIN Employees B
ON A.manager_id = B.emp_id;

3. What is a Foreign Key?

A Foreign Key is a column that creates a relationship between two tables. It references the Primary Key of another table.

It helps maintain referential integrity in the database.


CREATE TABLE Orders (
  order_id INT PRIMARY KEY,
  customer_id INT,
  FOREIGN KEY (customer_id) REFERENCES Customers(customer_id)
);

4. What is a Primary Key?

A Primary Key uniquely identifies each record in a table.

  • Cannot contain NULL values
  • Must be unique
  • Only one primary key per table

5. What is the difference between Primary Key and Foreign Key?

Primary Key Foreign Key
Uniquely identifies a record Creates relationship between tables
Cannot be NULL Can be NULL
One per table Multiple allowed

6. What is the difference between INNER JOIN and LEFT JOIN?

INNER JOIN returns only matching records from both tables.

LEFT JOIN returns all records from the left table and matching records from the right table.


SELECT * FROM A
INNER JOIN B ON A.id = B.id;

SELECT * FROM A
LEFT JOIN B ON A.id = B.id;

7. What is Normalization?

Normalization is the process of organizing data to reduce redundancy and improve data integrity.

Common normal forms:

  • 1NF – Atomic values
  • 2NF – No partial dependency
  • 3NF – No transitive dependency

8. What is Denormalization?

Denormalization is the process of combining tables to improve read performance.

It is used mainly in reporting and data warehouse systems.


9. What is a Unique Key?

A Unique Key ensures that all values in a column are unique.

  • Allows one NULL value
  • More than one unique key allowed per table

10. What is Database Testing?

Database Testing involves validating:

  • Data accuracy
  • Data integrity
  • Stored procedures
  • Triggers
  • Data migration

Conclusion

These basic database testing interview questions help testers understand SQL concepts clearly and confidently face interviews. Practicing SQL queries along with theory gives you an added advantage.

Happy Learning & Happy Testing! 🚀

White Box Testing Technique


White Box Testing Technique with Examples

White Box Testing Technique with Example

White Box Testing is a software testing technique in which the internal structure, source code, and logic of an application are tested. It is also known as Clear Box Testing, Glass Box Testing, or Structural Testing.

In this testing approach, the tester has complete knowledge of the application’s internal code and design.

Why is it called White Box Testing?

It is called White Box because the tester can “see inside” the application, just like looking through a transparent (white) box.

Who Performs White Box Testing?

  • Developers
  • Automation Testers
  • Testers with programming knowledge

What is Tested in White Box Testing?

  • Source code
  • Conditional logic (if–else)
  • Loops and branches
  • Code paths
  • Security vulnerabilities

White Box Testing Techniques

1. Statement Coverage

Ensures that every line of code is executed at least once.

2. Branch Coverage

Ensures that every possible branch (true/false) is tested.

3. Path Coverage

Ensures that all possible execution paths in the code are tested.

4. Loop Coverage

Focuses on validating different loop conditions like zero, one, and multiple iterations.

White Box Testing Example

Consider the following Java code:


public int findMax(int a, int b) {
    if (a > b) {
        return a;
    } else {
        return b;
    }
}

Test Scenarios

  • Test Case 1: a = 10, b = 5 → Output = 10 (if condition true)
  • Test Case 2: a = 5, b = 10 → Output = 10 (else condition)

Using these two test cases, we achieve 100% statement and branch coverage.

Advantages of White Box Testing

  • Improves code quality
  • Helps identify hidden bugs
  • Optimizes code performance
  • Early defect detection

Disadvantages of White Box Testing

  • Requires programming knowledge
  • Time-consuming for large applications
  • Cannot detect missing requirements

When to Use White Box Testing?

  • Unit testing
  • Code optimization
  • Security testing
  • Automation framework validation
Note: White Box Testing is usually combined with Black Box Testing to ensure complete test coverage.

White Box vs Black Box Testing

White Box Testing Black Box Testing
Requires code knowledge No code knowledge required
Focuses on internal logic Focuses on functionality
Usually done by developers Usually done by testers

Conclusion

White Box Testing is a powerful technique that ensures the internal quality of software. By testing code logic, branches, and paths, it helps deliver a stable, secure, and high-quality application.

Happy Testing! 🚀

Tuesday, 14 October 2025

Software Testing New Home Page 10/2025

Way2Testing - Home

Friday, 26 September 2025

Software Testing Tutorials Home Page

Java Tutorials

Selenium Tutorials

Maven Tutorials

Appium Tutorials

Wednesday, 30 April 2025

Utility class in java


Utility class in Java:


A Utility Class in Java is a class that contains only static methods (and sometimes static variables) which perform common, reusable operations. These are often helper classes that group together functions used throughout your codebase, such as string manipulation, file I/O helpers, date-time operations, etc.



Characteristics of a Utility Class:


1). All methods are static
2). It is not meant to be instantiated.
3). Mark the constructor private to prevent object creation.

Example :



public final class MathUtils {
// Private constructor to prevent instantiation
private MathUtils() {
throw new UnsupportedOperationException("Utility class");
}

public static int add(int a, int b) {
return a + b;
}

public static int max(int a, int b) {
return a > b ? a : b;
}
}

Few More

DataBase Testing Interview Questions

Basic Database Testing Interview Questions with Answers Basic Database Testing Interview Questions with An...