What Is Database Testing?
Database testing is the process of validating backend data stored in a database to ensure it is accurate, consistent, secure, and aligned with business requirements. While UI testing focuses on what users see, database testing focuses on what is actually stored and processed behind the application.
In service-based companies like Capgemini, applications deal with huge volumes of enterprise data across domains such as banking, healthcare, insurance, and e-commerce. That’s why capgemini interview questions for database testing strongly focus on SQL, data integrity, and real-time scenarios.
Why Database Testing Is Used
- To validate UI/API data vs database data
- To enforce business rules at DB level
- To prevent data duplication or loss
- To ensure transaction accuracy and audit trails
Step-by-Step Database Testing Workflow
1. Understand Business Requirements
- What data is created or modified?
- Which fields are mandatory?
- What calculations or rules exist?
2. Schema & Table Validation
- Table names and columns
- Data types and lengths
- Default values
3. Constraint Validation
- Primary Key
- Foreign Key
- NOT NULL
- UNIQUE
4. CRUD Validation
| Operation | Purpose | SQL Used |
| Create | Insert data | INSERT |
| Read | Fetch data | SELECT |
| Update | Modify data | UPDATE |
| Delete | Remove data | DELETE |
5. Advanced DB Validation
- Indexes (performance)
- Stored Procedures (business logic)
- Triggers (logging & audit)
- Transactions (commit/rollback)
Capgemini Interview Questions for Database Testing (100+ Q&A)
Basic Database Testing Interview Questions (1–20)
1. What is database testing?
Database testing validates backend data using SQL queries to ensure accuracy and integrity.
2. Why is database testing important in Capgemini projects?
Because Capgemini works on enterprise-scale systems where even small data errors can cause major business impact.
3. What skills are required for database testing?
- SQL knowledge
- Understanding of database concepts
- Business logic understanding
4. What is CRUD?
- Create – INSERT
- Read – SELECT
- Update – UPDATE
- Delete – DELETE
5. What is a primary key?
A column that uniquely identifies each record.
6. What is a foreign key?
A column that creates a relationship between two tables.
7. What is data integrity?
Ensuring data is accurate and consistent across tables.
8. What is normalization?
Reducing data redundancy.
9. What is denormalization?
Adding redundancy for performance.
10. What is a schema?
A logical container for database objects.
SQL Interview Questions for Testing (21–45)
21. Fetch all records from a table
SELECT * FROM users;
22. Fetch users older than 30
SELECT * FROM users WHERE age > 30;
23. Fetch unique cities
SELECT DISTINCT city FROM customers;
24. Sort records by date
SELECT * FROM orders ORDER BY created_date DESC;
25. What is GROUP BY?
Groups rows with the same values.
SELECT department, COUNT(*)
FROM employees
GROUP BY department;
26. What is HAVING?
Filters grouped data.
SELECT department, COUNT(*)
FROM employees
GROUP BY department
HAVING COUNT(*) > 5;
27. Difference between WHERE and HAVING?
| WHERE | HAVING |
| Filters rows | Filters groups |
| Used before GROUP BY | Used after GROUP BY |
JOIN-Based Capgemini Database Testing Questions (46–65)
46. What is a JOIN?
Used to combine data from multiple tables.
47. Types of JOINs
- INNER JOIN
- LEFT JOIN
- RIGHT JOIN
- FULL JOIN
48. INNER JOIN example
SELECT o.order_id, c.name
FROM orders o
INNER JOIN customers c
ON o.customer_id = c.id;
49. LEFT JOIN use case
Find records without matching data.
SELECT c.name, o.order_id
FROM customers c
LEFT JOIN orders o
ON c.id = o.customer_id;
50. Scenario: Customers with no orders
SELECT c.id
FROM customers c
LEFT JOIN orders o
ON c.id = o.customer_id
WHERE o.id IS NULL;
Indexes, Stored Procedures & Triggers (66–85)
66. What is an index?
Improves query performance by reducing table scans.
67. Types of indexes
- Clustered
- Non-clustered
- Composite
68. How do testers validate index usage?
By checking execution plans using EXPLAIN.
69. What is a stored procedure?
Pre-compiled SQL code stored in the database.
70. Stored procedure example
CREATE PROCEDURE getUser(IN uid INT)
BEGIN
SELECT * FROM users WHERE id = uid;
END;
71. How do testers test stored procedures?
- Validate inputs
- Verify outputs
- Check error handling
72. What is a trigger?
Automatically executes SQL on INSERT/UPDATE/DELETE.
73. Trigger example
CREATE TRIGGER audit_update
AFTER UPDATE ON orders
FOR EACH ROW
INSERT INTO audit_log VALUES (NEW.id, NOW());
Scenario Based Database Testing Interview Questions (86–110)
86. Scenario: Validate user registration
- Record inserted
- Default values assigned
SELECT * FROM users WHERE email=’test@gmail.com’;
87. Scenario: Validate update operation
SELECT address FROM users WHERE id=101;
88. Scenario: Validate soft delete
SELECT * FROM users WHERE is_active=’N’;
89. Scenario: Detect duplicate records
SELECT email, COUNT(*)
FROM users
GROUP BY email
HAVING COUNT(*) > 1;
90. Scenario: Validate bank fund transfer
- Debit from sender
- Credit to receiver
- Balance updated
SELECT balance FROM accounts WHERE acc_id=101;
91. Scenario: Validate rollback
- Force failure
- Ensure no partial data saved
Advanced Database Testing Interview Questions (111–130)
111. What is a transaction?
A set of SQL statements executed as a single unit.
112. What are ACID properties?
- Atomicity
- Consistency
- Isolation
- Durability
113. What is a deadlock?
Two transactions waiting for each other indefinitely.
114. What is isolation level?
Controls visibility of uncommitted data.
115. What is data migration testing?
Validating data accuracy after migration.
Real-Time Use Cases in Capgemini Projects
🏦 Banking
- Transaction validation
- Balance calculation
- Audit log verification
🏥 Healthcare
- Patient data integrity
- Medical history validation
- Compliance checks
🛒 E-commerce
- Order vs payment reconciliation
- Inventory update validation
- Refund processing checks
Common Mistakes Testers Make
- Validating only UI data
- Ignoring NULL and default values
- Skipping rollback testing
- Missing negative scenarios
- Not validating performance
Quick Revision Sheet
✔ SELECT, WHERE, ORDER BY
✔ JOIN types
✔ GROUP BY, HAVING
✔ CRUD operations
✔ Index basics
✔ Stored procedures
✔ Triggers
✔ Transactions
FAQs – Capgemini Interview Questions for Database Testing
Q1. Is SQL mandatory for Capgemini testing interviews?
Yes, SQL is a core skill.
Q2. Are scenario-based questions common?
Yes, scenario based database testing questions with answers are frequently asked.
Q3. Which databases are commonly used?
Oracle, MySQL, SQL Server, PostgreSQL.
