Sie sind auf Seite 1von 5

FILTER AND ROUTER TRANSFORMATION

Create ETL Mapping to transform below source data to target. {Source script is attached}z

Source Definition

Source - Customer
customer_id first_name last_name Job_id Address Deptno
#22, SRT, Street 9, 10
200001 Thomas Pastka It_Prog NK_30501%
*23, SRT, Street 10, RK, 30
200002 Allen Morley It_sales 30501
24_SRT, Street 11, NK, 20
200003 Mickel Pret It_mkt 30501
#25, SRT, Street 12, NK, 30
200004 alexander Gabriel It 30501
200005 John Cena ItHR 26, SRT, Street 13, CK, 30501 40
*27, SRT% Street 14% NK, 20
200006 Scott Adkins ItFIN 30501

Q-1: I want to find those employees whose job_id starts with IT_.

Target - Customer
customer_id first_name last_name Job_id Address Deptno
#22, SRT, Street 9, 10
200001 Thomas Pastka It_Prog NK_30501%
*23, SRT, Street 10, RK, 30
200002 Allen Morley It_sales 30501
24 SRT, Street 11, NK, 20
200003 Mickel Pret It_mkt 30501

Q-2: I want to find those employees whose address contains atleast one _ or one %.

Target - Customer
customer_id first_name last_name Job_id Address Deptno
#22, SRT, Street 9, 10
200001 Thomas Pastka It_Prog NK_30501%

Q-3: I want to find those employees whose address contains two %.

Page 1
Target - Customer
customer_id first_name last_name Job_id Address Deptno
*27, SRT% Street 14% NK, 20
200006 Scott Adkins ItFIN 30501

Q-4: I want to find those employees whose address contains no special characters.

Target - Customer
customer_id first_name last_name Job_id Address Deptno
200003 Mickel Pret It_mkt 24 SRT, Street 11, NK, 30501 20
200005 John Cena ItHR 26, SRT, Street 13, CK, 30501 40

Q-5: I want to find those employees whose first_name contains an a or e at any position.

Target - Customer
customer_id first_name last_name Job_id Address Deptno
#22, SRT, Street 9, 10
200001 Thomas Pastka It_Prog NK_30501%
*23, SRT, Street 10, RK, 30
200002 Allen Morley It_sales 30501
24_SRT, Street 11, NK, 20
200003 Mickel Pret It_mkt 30501
#25, SRT, Street 12, NK, 30
200004 alexander Gabriel It 30501

Q-6: I want to find those employees who are working in deptno 10,20,30.

Target - Customer
customer_id first_name last_name Job_id Address Deptno
#22, SRT, Street 9, 10
200001 Thomas Pastka It_Prog NK_30501%
*23, SRT, Street 10, RK, 30
200002 Allen Morley It_sales 30501
24_SRT, Street 11, NK, 20
200003 Mickel Pret It_mkt 30501
#25, SRT, Street 12, NK, 30
200004 alexander Gabriel It 30501
*27, SRT% Street 14% NK, 20
200006 Scott Adkins ItFIN 30501

Page 2
Q-2-Create a mapping to populate different EMP tables based on the DEPTNO of employee.

Source Data:

EMP_ALL Table Data:

EMPNO ENAME JOB SAL COMM DEPT


14ROOSEVELT CPA 35000 1
5LINCOLN TECH 22500 1400 4
5LINCOLN TECH 22500 1400 4
9JACKSON CEO 75000 4
8GRANT ENGINEER 32000 5

Target Data:

EMP_1 Data:

EMPNO ENAME JOB SAL COMM DEPT


14ROOSEVELTCPA 35000 1

EMP_4 Table Data:

EMPNO ENAME JOB SAL COMM DEPT


5LINCOLN TECH 22500 1400 4
5LINCOLN TECH 22500 1400 4
9JACKSON CEO 75000 4

EMP_ALL Table Data:

EMPNO ENAME JOB SAL COMM DEPT


5

8GRANT ENGINEER 32000

Page 3
Q-3-Suppose we have to load three targets in such a way like

Target - Customer_Table
customer_id name Phone Address Salary
00200001 Pastka, Thomas 9988776655 #22, SRT, Street 9, NK, 30501 10500
00200002 Morley, Clark 9988776654 #23, SRT, Street 10, RK, 30501 7000
00200003 Pret, Mickel 9988776653 #24, SRT, Street 11, NK, 30501 9000
00200004 Gabriel, Peter 9988776652 #25, SRT, Street 12, NK, 30501 17000
00200005 Cena, John 9988776651 #26, SRT, Street 13, CK, 30501 12000
00200006 Allen , Hopkins 9988776657 #29, SRT, Street 13, CK, 30501 9000
00200007 Steve , Robins 9988776688 #28, SRT, Street 13, CK, 30501 24000
00200008 Adkins, Scott 9988776650 #27, SRT, Street 14, NK, 30501 14000

1) the first target should be loaded with even no. of records

Target - Customer_Table
customer_id name Phone Address Salary
00200002 Morley, Clark 9988776654 #23, SRT, Street 10, RK, 30501 7000
00200004 Gabriel, Peter 9988776652 #25, SRT, Street 12, NK, 30501 17000
00200006 Allen , Hopkins 9988776657 #29, SRT, Street 13, CK, 30501 9000
00200008 Adkins, Scott 9988776650 #27, SRT, Street 14, NK, 30501 14000

2) the second target should be loaded with odd no. of records

Target - Customer_Table
customer_id name Phone Address Salary
00200001 Pastka, Thomas 9988776655 #22, SRT, Street 9, NK, 30501 10500
00200003 Pret, Mickel 9988776653 #24, SRT, Street 11, NK, 30501 9000
00200005 Cena, John 9988776651 #26, SRT, Street 13, CK, 30501 12000
00200007 Steve , Robins 9988776688 #28, SRT, Street 13, CK, 30501 24000

Page 4
3) the third target should be loaded with 3,6,9 ... records

Target - Customer_Table
customer_id name Phone Address Salary
00200003 Pret, Mickel 9988776653 #24, SRT, Street 11, NK, 30501 9000
00200006 Allen , Hopkins 9988776657 #29, SRT, Street 13, CK, 30501 9000

Page 5

Das könnte Ihnen auch gefallen