0% found this document useful (0 votes)
371 views14 pages

Database Schema Validation

The document describes test cases to validate data migration from an EMPLOYEES source table to an EMP_TOTSAL_TRG target table. It includes test cases to check the number of records and columns in both tables, compare records between the tables, and check for any missing or duplicate records in the target table. The test cases will execute SQL queries to validate the data migration results.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as XLSX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
371 views14 pages

Database Schema Validation

The document describes test cases to validate data migration from an EMPLOYEES source table to an EMP_TOTSAL_TRG target table. It includes test cases to check the number of records and columns in both tables, compare records between the tables, and check for any missing or duplicate records in the target table. The test cases will execute SQL queries to validate the data migration results.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as XLSX, PDF, TXT or read online on Scribd
You are on page 1/ 14

Test case # Test Case Name

TC_HRSRC_EMP01 Check number of columns in EMPLOYEES Table

TC_HRSRC_EMP02 Check Data type of the columns in EMPLOYEES Table

TC_HRSRC_EMP03 Check size of the columns in EMPLOYEES Table

TC_HRSRC_EMP04 Check Contraints of columns in EMPLOYEES Table

TC_HRSRC_EMP05 Check Indexes of Columns in EMPLOYEES Table


Step
Test Case Type Action/Query
No
Source Schema validation 1 select count(*)
from user_tab_columns
where table_name='EMPLOYEES';
Source Schema validation 1 SELECT column_name, data_type FROM
user_tab_columns where table_name =
'EMPLOYEES';
Source Schema validation 1 SELECT column_name, data_length FROM
user_tab_columns where table_name =
'EMPLOYEES';
Source Schema validation 1 SELECT column_name,constraint_name from
user_cons_columns where table_name =
'EMPLOYEES';
Source Schema validation 1 SELECT COLUMN_NAME,INDEX_NAME from
dba_ind_columns where
table_name='EMPLOYEES' AND
INDEX_OWNER='HR';
Expected Results Comments/Queries Status
11 11 Passed

Verify result should be as per the design. as expected Passed

Verify result should be as per the design.

Verify result should be as per the design. as expected Passed

Verify result should be as per the design. as expected Passed


Test case # Test Case Name
TC_HRTRG_EMP01 Check number of columns in EMP_TOTSAL_TRG Table

TC_HRTRG_EMP02 Check Data type of the columns in EMP_TOTSAL_TRG Table

TC_HRTRG_EMP03 Check size of the columns in EMP_TOTSAL_TRG Table

TC_HRTRG_EMP04 Check Contraints of columns in EMP_TOTSAL_TRG Table

TC_HRTRG_EMP05 Check Indexes of Columns in EMP_TOTSAL_TRG Table


Step
Test Case Type Action/Query
No
Target schema validation 1 select count(*)
from user_tab_columns
where table_name='EMP_TOTSAL_TRG';
Target schema validation 1 SELECT column_name, data_type FROM
user_tab_columns where table_name =
'EMP_TOTSAL_TRG';
Target schema validation 1 SELECT column_name, data_length FROM
user_tab_columns where table_name =
'EMP_TOTSAL_TRG';
Target schema validation 1 SELECT column_name,constraint_name from
user_cons_columns where table_name =
'EMP_TOTSAL_TRG';
Target schema validation 1 SELECT COLUMN_NAME,INDEX_NAME from
dba_ind_columns where
table_name='EMP_TOTSAL_TRG' AND
INDEX_OWNER='HR';
Expected Results Comments/Queries Result
10 As Expecteds Passed

Verify result should be as per the design.

Verify result should be as per the design.

Verify result should be as per the design. As Expecteds Passed

Verify result should be as per the design. indexes not mapped Failed
Test case # Test Case Name
TC_MAP1_01 Check number of records present in Source table
TC_MAP1_02 Check number of records present in Target table after data is loaded
TC_MAP1_03 Check the records pulled from source table(s) after tranformations applied

TC_MAP1_04 Check the records loaded in to target table(s)

TC_MAP1_05 Check the records present in source table which are not in target table

TC_MAP1_06 Check the records present in target table which are not in source table
TC_MAP1_07 Check if any records missed from source to tartget tables

TC_MAP1_08 Check if any Duplicate records in target tables


Test Case Type Step No
Data validation 1
Data validation 2
Data validation 3

Data validation 4

Data validation 5

Data validation 6
Data validation 7

Data validation
8
Action/Query
Select count(*) From EMPLOYEES
Select count(*) From EMP_TOTSAL_TRG
SELECT EMPLOYEE_ID, FIRST_NAME,LAST_NAME,EMAIL,PHONE_NUMBER ,
ROUND((SYSDATE-HIRE_DATE)/365,0) EXPEREINCE, JOB_ID,
NVL(SALARY,0) + NVL(COMMISSION_PCT,0) TOTAL_SALARY,
MANAGER_ID,DEPARTMENT_ID FROM EMPLOYEES

SELECTEMPLOYEE_ID,
FIRST_NAME,LAST_NAME,EMAIL,PHONE_NUMBER ,EXPEREINCE,TOTAL_SALARY,MANAGER_ID,DEPARTME
NT_ID FROM EMP_TOTSAL_TRG
SELECT EMPLOYEE_ID, FIRST_NAME,LAST_NAME,EMAIL,PHONE_NUMBER ,
ROUND((SYSDATE-HIRE_DATE)/365,0) EXPEREINCE, JOB_ID,
NVL(SALARY,0) + NVL(COMMISSION_PCT,0) TOTAL_SALARY,
MANAGER_ID,DEPARTMENT_ID FROM EMPLOYEES

MINUS

SELECTEMPLOYEE_ID,
FIRST_NAME,LAST_NAME,EMAIL,PHONE_NUMBER ,EXPEREINCE,TOTAL_SALARY,MANAGER_ID,DEPARTME
NT_ID FROM EMP_TOTSAL_TRG

SELECTEMPLOYEE_ID,
FIRST_NAME,LAST_NAME,EMAIL,PHONE_NUMBER ,EXPEREINCE,TOTAL_SALARY,MANAGER_ID,DEPARTME
NT_ID FROM EMP_TOTSAL_TRG

MINUS

SELECT EMPLOYEE_ID, FIRST_NAME,LAST_NAME,EMAIL,PHONE_NUMBER ,


ROUND((SYSDATE-HIRE_DATE)/365,0) EXPEREINCE, JOB_ID,
NVL(SALARY,0) + NVL(COMMISSION_PCT,0) TOTAL_SALARY,
MANAGER_ID,DEPARTMENT_ID FROM EMPLOYEES;
SELECT EMPLOYEE_ID, FIRST_NAME,LAST_NAME,EMAIL,PHONE_NUMBER ,
ROUND((SYSDATE-HIRE_DATE)/365,0) EXPEREINCE, JOB_ID,
NVL(SALARY,0) + NVL(COMMISSION_PCT,0) TOTAL_SALARY,
MANAGER_ID,DEPARTMENT_ID FROM EMPLOYEES

MINUS

SELECTEMPLOYEE_ID,
FIRST_NAME,LAST_NAME,EMAIL,PHONE_NUMBER ,EXPEREINCE,TOTAL_SALARY,MANAGER_ID,DEPARTME
NT_ID FROM EMP_TOTSAL_TRG

UNION

SELECTEMPLOYEE_ID,
FIRST_NAME,LAST_NAME,EMAIL,PHONE_NUMBER ,EXPEREINCE,TOTAL_SALARY,MANAGER_ID,DEPARTME
NT_ID FROM EMP_TOTSAL_TRG

MINUS

SELECT EMPLOYEE_ID, FIRST_NAME,LAST_NAME,EMAIL,PHONE_NUMBER ,


ROUND((SYSDATE-HIRE_DATE)/365,0) EXPEREINCE, JOB_ID,
NVL(SALARY,0) + NVL(COMMISSION_PCT,0) TOTAL_SALARY,
MANAGER_ID,DEPARTMENT_ID FROM EMPLOYEES;

SELECT * FROM EMP_TOTSAL_TRG WHERE ROWID IN (


SELECT rowid FROM EMP_TOTSAL_TRG GROUP BY rowid HAVING COUNT(*)>1);
Actual
Expected Results Results
107 Passed
107 Passed
As per the design Passed

As per the design Passed

No Records Found Failed

No Records Found Failed


No Records Found Failed

No Records Found

You might also like