Professional Documents
Culture Documents
Day – 1 (01-09-2017)
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 |
'-----+-----+------'
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 |
'-----+-----+------'
.-----+-----+------.
| tLogRow_3 |
|=----+-----+-----=|
|empno|ename|deptno|
|=----+-----+-----=|
|102 |bbb |10 |
|101 |aaa |10 |
|101 |aaa |10 |
|105 |eee |30 |
'-----+-----+------'
Day – 7 (11-09-2017)
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.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)
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|
'------+-----+-------------------'
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:
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:
Day – 17(25-09-2017)
Day – 20 (28-09-2017)
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|
'------+-------------+---------------------------'
Input:
Intitution_ID;Intitution_Name;Intitution_Address;Intitution_Course;Institution_CourseName
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)