You are on page 1of 9

Talend for Data Integreation

Day – 1 (01-09-2017)

1. How to generate sequence numbers using tMap?

Day – 2 (04-09-2017)

2. Design a mapping to load the first 3 rows from a flat file into a target?
3. Design a mapping to load the last 3 rows from a flat file into a target?

Day – 3 (05-09-2017)

4. How to load half of source table records into one target and remaining half into another target.

Day – 4 (06-09-2017)

5. Design a mapping to load the first record from a flat file into one table A, the last record from a flat
file into table B and the remaining records into table C?

Day – 5 (07-09-2017)

6. Consider the following Employee data which contain duplicate rows with department wise.
empno,ename,deptno
101,aaa,10
102,bbb,10
103,ccc,20
104,ddd,30
105,eee,30
106,fff,50
101,aaa,10
101,aaa,10

6.1. Design a mapping to load all unique products in one table and the duplicate rows in another
table.
The first table should contain the following output

.-----+-----+------.
| tLogRow_1 |
|=----+-----+-----=|
|empno|ename|deptno|
|=----+-----+-----=|
|103 |ccc |20 |
|106 |fff |50 |
'-----+-----+------'

The second target should contain the following output


.-----+-----+------.
| tLogRow_3 |
|=----+-----+-----=|
|empno|ename|deptno|
|=----+-----+-----=|
|101 |aaa |10 |
|102 |bbb |10 |
|104 |ddd |30 |
|105 |eee |30 |
|101 |aaa |10 |
|101 |aaa |10 |
'-----+-----+------'
Day – 6 (08-09-2017)

6.2. Design a mapping to load each employee once into one table and the remaining employees which
are duplicated into another table.
The first table should contain the following output(Original records)
.-----+-----+------.
| tLogRow_2 |
|=----+-----+-----=|
|empno|ename|deptno|
|=----+-----+-----=|
|101 |aaa |10 |
|103 |ccc |20 |
|104 |ddd |30 |
|106 |fff |50 |
'-----+-----+------'

The second table should contain the following output(Duplicate records)

.-----+-----+------.
| tLogRow_3 |
|=----+-----+-----=|
|empno|ename|deptno|
|=----+-----+-----=|
|102 |bbb |10 |
|101 |aaa |10 |
|101 |aaa |10 |
|105 |eee |30 |
'-----+-----+------'

Day – 7 (11-09-2017)

7. Consider the following Department data as source

Dept_id,Sal
10,1000
10,2000
10,5000
20,2000
20,6000
30,3000

Q1. Design a mapping to load the Cumulative sum of salaries of employees with department wise
into target table?
The target table data should look like as

.-------+----+-------.
| tLogRow_1 |
|=------+----+------=|
|Dept_id|Sal |Cum_Sal|
|=------+----+------=|
|10 |1000|1000 |
|10 |2000|3000 |
|10 |5000|8000 |
|20 |2000|2000 |
|20 |6000|8000 |
|30 |3000|3000 |
'-------+----+-------'

Day – 8 (12-09-2017)

8. Consider the following employees data as source .


id,name,sal
10,aaa,1000
10,aaa,1000
20,bbb,2000
20,bbb,2000
30,ccc,3000
10,ddd,2000
20,eee,3000
30,fff,4000
40,ggg,5000
10,ggg,3000

8.1. Design a mapping to get the pervious row salary for the current row. If there is no pervious row
exists for the current row, then the pervious row salary should be displayed as null.
The output should look like as

.--+----+----+-------.
| tLogRow_1 |
|=-+----+----+------=|
|id|name|sal |Pre_Sal|
|=-+----+----+------=|
|10|aaa |1000|0 |
|10|aaa |1000|1000 |
|20|bbb |2000|1000 |
|20|bbb |2000|2000 |
|30|ccc |3000|2000 |
|10|ddd |2000|3000 |
|20|eee |3000|2000 |
|30|fff |4000|3000 |
|40|ggg |5000|4000 |
|10|ggg |3000|5000 |
'--+----+----+-------'

Day – 9 (13-09-2017)

8.2. Design a mapping to get the next row salary for the current row. If there is no next row for the
current row, then the next row salary should be displayed as null.
The output should look like as

.--+----+----+--------.
| tLogRow_1 |
|=-+----+----+-------=|
|id|name|sal |Next_Sal|
|=-+----+----+-------=|
|10|aaa |1000|1000 |
|10|aaa |1000|2000 |
|20|bbb |2000|2000 |
|20|bbb |2000|3000 |
|30|ccc |3000|2000 |
|10|ddd |2000|3000 |
|20|eee |3000|4000 |
|30|fff |4000|5000 |
|40|ggg |5000|3000 |
|10|ggg |3000|null |
'--+----+----+--------'

Day – 10 (14-09-2017)

8.3. Design a mapping to find the Total sum of salaries of all employees and this sum should repeat
for all the rows.
The output should look like as

.--+----+----+---------.
| tLogRow_1 |
|=-+----+----+--------=|
|id|name|sal |O_sum_sal|
|=-+----+----+--------=|
|10|aaa |1000|26000 |
|10|aaa |1000|26000 |
|20|bbb |2000|26000 |
|20|bbb |2000|26000 |
|30|ccc |3000|26000 |
|10|ddd |2000|26000 |
|20|eee |3000|26000 |
|30|fff |4000|26000 |
|40|ggg |5000|26000 |
|10|ggg |3000|26000 |
'--+----+----+---------'

Day – 11 (15-09-2017)

9. Consider the following employees table as source

deptno,ename
20,R
10,A
10,D
20,P
10,B
10,C
20,Q
20,S
20,T
20,R

9.1. Design a mapping to load a target table with the following values from the above source?

.------+-----+-------------------.
| tLogRow_1 |
|=-----+-----+------------------=|
|deptno|ename|O_emplist |
|=-----+-----+------------------=|
|10 |A |A |
|10 |D |A,D |
|10 |B |A,D,B |
|10 |C |A,D,B,C |
|20 |R |A,D,B,C,R |
|20 |P |A,D,B,C,R,P |
|20 |Q |A,D,B,C,R,P,Q |
|20 |S |A,D,B,C,R,P,Q,S |
|20 |T |A,D,B,C,R,P,Q,S,T |
|20 |R |A,D,B,C,R,P,Q,S,T,R|
'------+-----+-------------------'

Day – 12 (18-09-2017) and Day – 13 (19-09-2017)

9.2. Design a mapping to load a target table with the following values from the above source?

.------+-----+-----------.
| tLogRow_1 |
|=-----+-----+----------=|
|deptno|ename|O_emplist |
|=-----+-----+----------=|
|10 |A |A |
|10 |D |A,D |
|10 |B |A,D,B |
|10 |C |A,D,B,C |
|20 |R |R |
|20 |P |R,P |
|20 |Q |R,P,Q |
|20 |S |R,P,Q,S |
|20 |T |R,P,Q,S,T |
|20 |R |R,P,Q,S,T,R|
'------+-----+-----------'

9.3. Design a mapping to load a target table with the following values from the above source?

.------+-----------.
| tLogRow_1 |
|=-----+----------=|
|deptno|O_emplist |
|=-----+----------=|
|10 |A,D,B,C |
|20 |R,P,Q,S,T,R|
'------+-----------'

Day – 14 (20-09-2017)

10. Given below the student ranks based on their total marks and marks obtained in subject wise.

INPUT:

student_id maths science social english hindi telugu total_marks


1 95 90 87 85 65 80 502
2 95 85 92 65 85 80 502
3 88 85 98 64 75 77 487
4 85 78 94 64 56 48 425
5 78 85 96 56 64 63 442
6 78 85 90 62 63 64 442
7 85 75 65 88 77 95 485
8 95 85 92 85 65 80 502
9 60 62 63 48 52 42 327
10 60 62 63 48 53 41 327
Q.) Whoever got highest marks in Mathematics they should get highest rank.

If the total marks are same, then compare marks obtained in Mathematics. If Mathematics marks also equal then
compare marks obtained in science then social then English then Hindi then Telugu.

OUTPUT:

student_id maths science social english hindi telugu total_marks


1 95 90 87 85 65 80 502

Day – 15 (21-09-2017) & Day – 16 (22-09-2017)

11. Implemented custom SCD Type – II ?

Day – 17(25-09-2017)

12. Implemented Department number wise Dynamic file Generation?

Day – 18 (26-09-2017) & Day – 19 (27-09-2017)

13. Implemented Incremental Loading or CDC?

Day – 20 (28-09-2017)

14. Import excel file into MS-Access db?


15. Implement the Normalized data and De-Normalized data.

15.1.Normalized data

Input:

emp_no;emp_name;emp_skills

101;Avinash Gupta;java,C++,sql

102;Vikas Gupta;Oracle,HTML,JSP,AJAX

103;Mayank Arora;Talend,Informatica,Abinitio

Output:

.------+-------------+-----------.
| tLogRow_1 |
|=-----+-------------+----------=|
|emp_no|emp_name |emp_skills |
|=-----+-------------+----------=|
|101 |Avinash Gupta|java |
|101 |Avinash Gupta|C++ |
|101 |Avinash Gupta|sql |
|102 |Vikas Gupta |Oracle |
|102 |Vikas Gupta |HTML |
|102 |Vikas Gupta |JSP |
|102 |Vikas Gupta |AJAX |
|103 |Mayank Arora |Talend |
|103 |Mayank Arora |Informatica|
|103 |Mayank Arora |Abinitio |
'------+-------------+-----------'

15.2.De-Normalized:

Input:

emp_no;emp_name;emp_skills

101;Avinash Gupta;java

101;Avinash Gupta;C++

101;Avinash Gupta;sql

102;Vikas Gupta;Oracle

102;Vikas Gupta;HTML

102;Vikas Gupta;JSP

102;Vikas Gupta;AJAX

103;Mayank Arora;Talend

103;Mayank Arora;Informatica

103;Mayank Arora;Abinitio

Output:

.------+-------------+---------------------------.
| tLogRow_1 |
|=-----+-------------+--------------------------=|
|emp_no|emp_name |emp_skills |
|=-----+-------------+--------------------------=|
|101 |Avinash Gupta|java,C++,sql |
|102 |Vikas Gupta |Oracle,HTML,JSP,AJAX |
|103 |Mayank Arora |Talend,Informatica,Abinitio|
'------+-------------+---------------------------'

16. Implemented UnPivot Data by using custom component.

Input:

Intitution_ID;Intitution_Name;Intitution_Address;Intitution_Course;Institution_CourseName

101;NIIT;722 Bur Oak Avenue Berlin Germany;Course1;CS

101;NIIT;722 Bur Oak Avenue Berlin Germany;Course2;EE

101;NIIT;722 Bur Oak Avenue Berlin Germany;Course3;EC

102;AIIM;11 Collaroy 2093 Medrid Spain;Course1;BCOM

102;AIIM;11 Collaroy 2093 Medrid Spain;Course2;BBA

102;AIIM;11 Collaroy 2093 Medrid Spain;Course3;BCA

103;SRIT;223 Wellington 5011 London UK;Course1;BSC

103;SRIT;223 Wellington 5011 London UK;Course2;ME

103;SRIT;223 Wellington 5011 London UK;Course3;MTECH

Output:

.---------------+-------------------+-------------.
| tLogRow_1 |
|=--------------+-------------------+------------=|
|pivot_key |pivot_value |Intitution_ID|
|=--------------+-------------------+------------=|
|Intitution_Name|NIIT |101 |
|Address |722 Bur Oak Avenue |101 |
|City |Berlin |101 |
|Country |Germany |101 |
|Course_1 |CS |101 |
|Course_2 |EE |101 |
|Course_3 |EC |101 |
|Intitution_Name|AIIM |102 |
|Address |11 Collaroy 2093 |102 |
|City |Medrid |102 |
|Country |Spain |102 |
|Course_1 |MBA |102 |
|Course_2 |BBA |102 |
|Course_3 |BCA |102 |
|Intitution_Name|SRIT |103 |
|Address |223 Wellington 5011|103 |
|City |London |103 |
|Country |UK |103 |
|Course_1 |BSC |103 |
|Course_2 |ME |103 |
|Course_3 |MTECH |103 |
'---------------+-------------------+-------------'

Day – 21 (29-09-2017)

17. Implemented 2nd Max Salary Department wise.

You might also like