際際滷

際際滷Share a Scribd company logo
Unit 4 SLOWLY CHANGIN DIMENSION 2 
Exercise -1 Solution (SCD2)
https://www.oercommons.org/authoring/28550-etl-using-pentaho-spoon
https://www.oercommons.org/authoring/28693-etl-using-pentaho-spoon-lecture-notes-ppt-exercise
Dr. Girija Narasimhan 1
Exercise:
Create table employ2(eid number(5),ename varchar2(15),salary number(5));
insert into employ2 values(1001,'Alaa',1800);
insert into employ2 values(1002,'Ravi',1500);
select * from employ2;
create table emp_dim_scd2(emp_sur_key number(5),date_from date,date_to date,version number(6),dim_eid
number(5),ename varchar2(15),salary number(5));
update employ2 set salary=2500 where eid=1001;
select * from emp_dim_scd2;
insert into employ2 values(1003,'Suha',1900);
Dr. Girija Narasimhan 2
Dr. Girija Narasimhan 3
Create employ2 table and emp_dim_scd2 table
Dr. Girija Narasimhan 4
Drag and include Table Input
Connect the table employ2 table and preview the data
Dr. Girija Narasimhan 5
Drag and include dimension lookup/update
connect table input with dimension lookup/update
Dr. Girija Narasimhan 6
Connect the database
Dr. Girija Narasimhan 7
Dr. Girija Narasimhan 8
Key field
surrogate key
Date from
Date to
Select Fields
Dr. Girija Narasimhan 9
Update the eid=1001 salary as 2500 in employ2 table
Dr. Girija Narasimhan 10
Execute the transformation
Dr. Girija Narasimhan 11
Preview data and updated record information
Dr. Girija Narasimhan 12
Check the emp_dim_scd1 table records updated history
Dr. Girija Narasimhan 13
Insert new record
Dr. Girija Narasimhan 14
Execute the transformation
Dr. Girija Narasimhan 15
Dr. Girija Narasimhan 16
Preview the data and
newly inserted record
information
Dr. Girija Narasimhan 17

More Related Content

Unit 4 scd2-exercise 1-solution