You are on page 1of 17

EMP_DTS_SRC Employee Management

Constrain
Column Name Data Type Nullable Reference
ts
EMP_ID int No PK
LAST_NAME varchar(100) Yes
FIRST_NAME varchar(100) Yes
MIDDLE_NAME varchar(100) No
EMP_SALARY decimal(10, 2) Yes
EMP_DOB datetime Yes
EMP_GENDER varchar(10) Yes
HIRE_DATE datetime No
EMP_DTS_SRC2 Employee Management
Constrain
Column Name Data Type Nullable Reference
ts
EMP_ID int No PK
LAST_NAME varchar(100) Yes
FIRST_NAME varchar(100) Yes
MIDDLE_NAME varchar(100) No
EMP_SALARY decimal(10, 2) Yes
EMP_DOB datetime Yes
EMP_GENDER varchar(10) Yes
HIRE_DATE datetime No
EMP_DTS_SRC3 Employee Management
Constrain
Column Name Data Type Nullable Reference
ts
EMP_ID int No PK
LAST_NAME varchar(100) Yes
FIRST_NAME varchar(100) Yes
MIDDLE_NAME varchar(100) No
EMP_SALARY decimal(10, 2) Yes
EMP_DOB datetime Yes
EMP_GENDER varchar(10) Yes
HIRE_DATE datetime No
EMP_DTS_TRG Employee Management
Constrain
Column Name Data Type Nullable Reference
ts
ID int No PK
EMP_ID int No
EMP_NAME varchar(100) No
EMP_SALARY decimal(10, 2) No
EMP_DOB datetime Yes
EMP_GENDER varchar(10) Yes
HIRE_DATE datetime Yes
TOTAL_EXP varchar(2) No
Audit_Action varchar(100) No
Audit_Timestamp datetime No
Mapping No. Source table Source Column Data Type Target Table
1 - - - EMP_DTS_TRG
2 EMP_DTS_SRC EMP_ID int EMP_DTS_TRG
3 EMP_DTS_SRC LAST_NAME varchar(100) EMP_DTS_TRG
4 EMP_DTS_SRC FIRST_NAME varchar(100) EMP_DTS_TRG
5 EMP_DTS_SRC MIDDLE_NAME varchar(100) EMP_DTS_TRG
6 EMP_DTS_SRC EMP_SALARY decimal(10, 2) EMP_DTS_TRG
7 EMP_DTS_SRC EMP_DOB datetime EMP_DTS_TRG
8 EMP_DTS_SRC EMP_GENDER varchar(10) EMP_DTS_TRG
9 EMP_DTS_SRC HIRE_DATE datetime EMP_DTS_TRG
10 EMP_DTS_TRG
11 EMP_DTS_TRG
12 EMP_DTS_TRG

Mapping No. Source table Source Column Data Type Target Table
1 - - - EMP_DTS_TRG
2 EMP_DTS_SRC2 EMP_ID int EMP_DTS_TRG
3 EMP_DTS_SRC2 LAST_NAME varchar(100) EMP_DTS_TRG
4 EMP_DTS_SRC2 FIRST_NAME varchar(100) EMP_DTS_TRG
5 EMP_DTS_SRC2 MIDDLE_NAME varchar(100) EMP_DTS_TRG
6 EMP_DTS_SRC2 EMP_SALARY decimal(10, 2) EMP_DTS_TRG
7 EMP_DTS_SRC2 EMP_DOB datetime EMP_DTS_TRG
8 EMP_DTS_SRC2 EMP_GENDER varchar(10) EMP_DTS_TRG
9 EMP_DTS_SRC2 HIRE_DATE datetime EMP_DTS_TRG
10 - - - EMP_DTS_TRG
11 - - - EMP_DTS_TRG
12 - - - EMP_DTS_TRG

Mapping No. Source table Source Column Data Type Target Table
1 - - - EMP_DTS_TRG
2 EMP_DTS_SRC3 EMP_ID int EMP_DTS_TRG
3 EMP_DTS_SRC3 LAST_NAME varchar(100) EMP_DTS_TRG
4 EMP_DTS_SRC3 FIRST_NAME varchar(100) EMP_DTS_TRG
5 EMP_DTS_SRC3 MIDDLE_NAME varchar(100) EMP_DTS_TRG
6 EMP_DTS_SRC3 EMP_SALARY decimal(10, 2) EMP_DTS_TRG
7 EMP_DTS_SRC3 EMP_DOB datetime EMP_DTS_TRG
8 EMP_DTS_SRC3 EMP_GENDER varchar(10) EMP_DTS_TRG
9 EMP_DTS_SRC3 HIRE_DATE datetime EMP_DTS_TRG
10 - - - EMP_DTS_TRG
11 - - - EMP_DTS_TRG
12 - - - EMP_DTS_TRG
Target Column Data Type TRANSFORMATION LOGIC
ID int Create seqence Number
EMP_ID int 1,1
EMP_NAME varchar(302) concat(LAST_NAME,FIRST_NAME,MIDDLE_NAME) seprate with '-'
EMP_NAME varchar(302) concat(LAST_NAME,FIRST_NAME,MIDDLE_NAME) seprate with '-'
EMP_NAME varchar(302) concat(LAST_NAME,FIRST_NAME,MIDDLE_NAME) seprate with '-'
EMP_SALARY decimal(10, 2) Insert only EMP_SALARY having greater or equal 1000.
EMP_DOB datetime 1.1
EMP_GENDER varchar(10) CONVERT 'MALE' TO 'M', 'FEMALE' TO 'F'
HIRE_DATE datetime 1.1
TOTAL_EXP varchar(2) (CURRENT DATE - HIRE DATE), SHOULD BE IN YEARS
Audit_Action varchar(100) INSERTED ACTION Message
Audit_Timestamp datetime INSERTED DATA TIME LOG

Target Column Data Type TRANSFORMATION


ID int Create seqence Number
EMP_ID int 1.1
EMP_NAME varchar(100) concat(LAST_NAME,FIRST_NAME,MIDDLE_NAME) seprate with '-'
EMP_NAME varchar(100) concat(LAST_NAME,FIRST_NAME,MIDDLE_NAME) seprate with '-'
EMP_NAME varchar(100) concat(LAST_NAME,FIRST_NAME,MIDDLE_NAME) seprate with '-'
EMP_SALARY decimal(10, 2) Insert only EMP_SALARY having greater or equal 1000.
EMP_DOB datetime 1.1
EMP_GENDER varchar(10) 1.1
HIRE_DATE datetime 1.1
TOTAL_EXP varchar(2) (CURRENT DATE - HIRE DATE), SHOULD BE IN YEARS
Audit_Action varchar(100) INSERTED ACTION Message
Audit_Timestamp datetime INSERTED DATA TIME LOG

Target Column Data Type TRANSFORMATION


ID int Create seqence Number
EMP_ID int 1.1
EMP_NAME varchar(100) concat(LAST_NAME,FIRST_NAME,MIDDLE_NAME) seprate with '-'
EMP_NAME varchar(100) concat(LAST_NAME,FIRST_NAME,MIDDLE_NAME) seprate with '-'
EMP_NAME varchar(100) concat(LAST_NAME,FIRST_NAME,MIDDLE_NAME) seprate with '-'
EMP_SALARY decimal(10, 2) Insert only EMP_SALARY having greater or equal 1000.
EMP_DOB datetime 1.1
EMP_GENDER varchar(10) CONVERT '1' to 'M', '2' to 'F'
HIRE_DATE datetime 1.1
TOTAL_EXP varchar(2) (CURRENT DATE - HIRE DATE), SHOULD BE IN YEARS
Audit_Action varchar(100) INSERTED ACTION Message
Audit_Timestamp datetime INSERTED DATA TIME LOG
Comment

Comment

Comment
Test Case Name :
Description:
Source Tables Name: EMP_DTS_SRC
Target Tables Name: EMP_DTS_TRC
Job Name:

ID Type Objective Action


1 P To validate ETL run Execute ETL code or job
2 P To validate the record count of the Verify the record count between
table. source and target table using count
query.

3 P To validate the null values of the Verify the null values of the table.
table.

4 P To validate Duplicate Records Verify duplicate records in target


table

5 P To validate Reject records Insert data in source table which is


not satisfying condition.
6 P To validate Transformation - Insert valid data in source table and
EMP_Name run the job.

7 N To validate Transformation - Insert data With invalid data, with


EMP_Name null in middle name

8 P To validate Transformation - To verify '-' in EMP_Name


EMP_Name

9 P To validate Transformation - Insert data With valid data


EMP_GENDER ex. MALE, FEMALE
10 N To validate Transformation - Insert invalid data e.g.
EMP_GENDER 'Null', other than MALE,FEMALE

11 P To validate Transformation - Insert valid data having salary


EMP_SALARY greater than '1000'
13 N To validate Transformation - Insert valid data having salary less
EMP_SALARY than to '1000'
14 N To validate Transformation - Insert valid data having salary Equal
EMP_SALARY to '1000'
14 P To validate the data having direct Verify and compare the data
mapping

15 To validate total experience Verify total exp column in taget able


transformation
Test Case : TC001
User Role: NA
Coverage: NA

Designed By: Date:


Tester 2/22/2019
Expected Result Data Validation Query
Code or Job should run succesfully select * from EMP_DTS_TRG;
Count between source and target table should be Select count(*)as
same. COUNT_OF_EMP_DTS_SRC1 from
EMP_DTS_SRC1
where EMP_SALARY >= '1000';

Select count(*)as COUNT_OF_EMP_DTS_TRG


from EMP_DTS_TRG
where audit_action ='Inserted Record
EMP_DTS_SRC1' ;

Null count between source and target table should select COUNT(*)-COUNT(ID) AS ID,COUNT(*)-
be same across all columns COUNT(EMP_ID) EMP_ID,COUNT(*)-
COUNT(EMP_GENDER) EMP_GENDER
,COUNT(*)-COUNT(EMP_NAME)
EMP_NAME ,COUNT(*)-COUNT(HIRE_DATE)
HIRE_DATE,
COUNT(*)-COUNT(Audit_Action)
Audit_Action
from EMP_DTS_TRG;

Duplicate should not get inserted in target table. SELECT EMP_ID, COUNT(*) AS
DuplicatesCount
FROM EMP_DTS_TRG
GROUP BY EMP_ID
having count(*)>1;

Reject Table's record should not get inserted in select * from EMP_DTS_TRG
target table. where EMP_SALARY <= '1000';
select * from EMP_DTS_TRG
where EMP_SALARY <= '1000';
EMP_NAME column should have data in this format SELECT EMP_ID, (LAST_NAME + '-' +
LAST_NAME-FIRST_NAME-MIDDLE_NAME FIRST_NAME + '-' + MIDDLE_NAME ) as
EMP_FULL_NAME
FROM EMP_DTS_SRC;

EMP_NAME column should have data in this format


LAST_NAME-FIRST_NAME-MIDDLE_NAME SELECT EMP_ID, (LAST_NAME + '-' +
FIRST_NAME + '-' + MIDDLE_NAME ) as
EMP_FULL_NAME
FROM EMP_DTS_SRC;

EMP_Name should separate with '-'

Data should get convert to 'M' and 'F' select * from EMP_DTS_TRG
where gender in ('M','F')
for any other data null should get inserted select * from EMP_DTS_TRG
where gender not in ('M','F')

Data should get inserted select * from EMP_DTS_TRG


where EMP_SALARY => '1000'
Data should not get inserted select * from EMP_DTS_TRG
where EMP_SALARY => '1000'
Data should get inserted select * from EMP_DTS_TRG
where EMP_SALARY => '1000'
Data should be available

Total experience should be in year system year - SELECT EMP_ID,DATEDIFF (YY,HIRE_DATE,GETDATE()) AS TOTAL_EXP FR
target table
Iteration : 1
Tester Date
Tester 2/22/2019
Test case Writer's Remark Actual Results Status Defect ID
Same as excepted Pass
Check count of all 3 source tables. Same as excepted Pass 1987256

source and target table Fail


Null count is not matching
CONCAT(LAST_NAME,FIRST_NAME
,MIDDLE_NAME) separate with '-'

CONCAT(LAST_NAME,FIRST_NAME
,MIDDLE_NAME) separate with '-'

Verify the target table data


correctness

Verify the target table data


correctness

count should get match with src table

count should get match with src table

count should get match with src table

Verify the target table data


correctness

_DATE,GETDATE()) AS TOTAL_EXP FROM EMP_DTS_SRC1;


Iteration : 2 Iteration : 2
Tester Date Tester
Tester 9/27/2019 Tester
Actual Results Status Defect ID Actual Results Status

source and target Fail 1987256 Same as excepted Pass


table count is not
matching
Date
9/27/2019
Defect ID

1987256

You might also like