ETL Test case -2 checks duplicates in target
ETL Source-Target Count Match
Test Case Title: ETL Duplicate Check in Target using SQL Query
Test Case ID: ETL-DUP-001
Test Objective:
To verify that the ETL process successfully identifies and eliminates duplicate records in the target
database using a SQL query
Preconditions:
1. Source data is available and accessible for extraction.
2. ETL process is configured and ready to run.
3. Target database is empty before executing the ETL process.
Test Steps:
1. Execute the ETL process to load data from the source to the target database
2. Connect to the target database using appropriate credentials.
3. Execute the following SQL query to identify duplicate records:
SELECT column1, column2, COUNT(*)
FROM target_table
GROUP BY column1, column2
HAVING COUNT(*) > 1;
Note: Replace column1, column2, and target_table with the actual column names and target table
name.
4. Verify that the SQL query returns no rows, indicating that there are no duplicates in the target
table. If duplicates are found, the test case fails.
5. Optionally, you can also execute a separate SQL query to retrieve the count of distinct records in
the target table:
SELECT COUNT(DISTINCT column1, column2)
FROM target_table;
Verify that the count obtained matches the number of records loaded into the target table. If the
counts do not match, the test case fails.
Test Data:
Prepare a dataset with both unique and duplicate records in the source data.
● Ensure that the ETL process is configured to eliminate duplicates during the load phase.
Expected Results:
ETL Test case_ 1 - Source-Target Count Match.pdf
ETL Source-Target Count Match
Test Case: Source and Target Count Validation
Test Case Description:
This test case verifies that the count of records in the source and target should be the same after an ETL
(Extract, Transform, Load) process. 25 It ensures that no data is lost or added during the transformation
process.
Test Steps:
1. Prepare a source dataset with a known number of records.
2. Perform the ETL process on the source dataset to transform it into the target dataset
3. Count the number of records in both the source and target datasets.
4. Compare the counts of records in the source and target datasets.
Expected Result:
The count of records in the source and target datasets should be the same, indicating that no data was
lost or added during the ETL process.
Test Data:
Source Dataset:
● Number of Records: 1000
Test Execution:
1. Perform the ETL process on the source dataset.
2. Count the number of records in both the source and target datasets.
Test Result:
● Number of Records in Source Dataset: 1000
● Number of Records in Target Dataset: 1000
Comparison:
The count of records in the source and target datasets is the same (1000), which indicates that the ETL
process was successful in maintaining the data integrity.
Test Case Status: Pass
ETL Test case-1 Source-Target Count Match.pdf
ETL Source-Target Count Match
Test Case Title: Source and Target Count Match Test
Test Case Description:
This test case verifies that the count of records in the source matches the count of records in the target
after running an ETL process using an SQL query.
Preconditions:
1. The ETL process is set up and configured properly.
2. The SQL query for extracting and loading data from source to target is defined and functioning
correctly.
Test Steps:
1. Identify the source table or database from which data is being extracted.
2. Execute the SQL query to retrieve the count of records from the source table and store it in a
variable (let's call it 'source_count').
3. Identify the target table or database where the data is being loaded.
4. Execute the SQL query to retrieve the count of records from the target table and store it in a
variable (let's call it 'target_count').
5. Compare 'source_count' with 'target_count' and verify that they are equal.
Expected Results:
'source_count' is equal to 'target_count'. 61 The test case passes.
Test Data:
Sample SQL queries:
● Source Count Query: SELECT COUNT(*) FROM source_table;
● Target Count Query: SELECT COUNT(*) FROM target_table;
Note: Make sure to replace 'source_table' and 'target_table' in the SQL queries with the appropriate table
or database names used in your ETL process.
Test Environment:
● Specify the database connection details, such as server address, port, username, and password.
● Ensure that the source and target databases are properly configured and accessible.
Test Case Execution: