際際滷

際際滷Share a Scribd company logo
Unit 2 Slowly Changing Dimension  SCD type 1 (Insert)
Dr. Girija Narasimhan 1
https://www.oercommons.org/authoring/28693-etl-using-pentaho-spoon-lecture-notes-ppt-exercise/2/view
https://www.oercommons.org/authoring/28550-etl-using-pentaho-spoon
create table student_scd1(sid number(5) not null,sname varchar2(15),mark1 number(5),result varchar2(10),grade
varchar2(3));
insert into student_scd1 values(11,'Ambu',89,'Pass','A');
insert into student_scd1 values(12,'Meenu',75,'Pass','B');
insert into student_scd1 values(13,'Jasica',45,Fail',D');
select * from student_scd1;
create table student_dim_scd1(dim_sid number(5) not null, sname varchar2(15),mark1 number(5),result
varchar2(10),grade varchar2(3));
insert into student_dim_scd1 values(11,'Ambu',89,'Pass','A');
insert into student_dim_scd1 values(12,'Meenu',75,'Pass','B');
insert into student_dim_scd1 values(13,'Jasica',45,'Fail','D');
select * from student_dim_scd1;
update student_scd1 set mark1=60,grade='C',Result='Pass' where sid=13;
select * from student_scd1; Dr. Girija Narasimhan 2
Dr. Girija Narasimhan 3
Dr. Girija Narasimhan 4
Drag and place the
table input
Dr. Girija Narasimhan 5
Right click the mouse in
Table input and select Edit
step
Dr. Girija Narasimhan 6
Select New get Database
connection details
Computer name in the
property of the system
Click the Test Button
Database name is xe, Database user
name hr and password of the user hr
13
4
2
5
Dr. Girija Narasimhan 7
Dr. Girija Narasimhan 8
Preview Data
Dr. Girija Narasimhan 9
Dr. Girija Narasimhan 10
Dr. Girija Narasimhan 11
Dr. Girija Narasimhan 12
Dr. Girija Narasimhan 13
Dr. Girija Narasimhan 14
Dr. Girija Narasimhan 15
Dr. Girija Narasimhan 16
Dr. Girija Narasimhan 17
Dr. Girija Narasimhan 18
Dr. Girija Narasimhan 19
Dr. Girija Narasimhan 20
Dr. Girija Narasimhan 21
Dr. Girija Narasimhan 22
Exercise:
create table employ1(eid number(5) not null,ename varchar2(15),salary number(5));
insert into employ1 values(1001,'Alaa',1800)
insert into employ1 values(12,Ravi',1500);
select * from employ1;
create table emp_dim_scd1(dim_eid number(5) not null, ename varchar2(15),salary number(5));
insert into emp_dim_scd1 values(1001,'Alaa',1800)
insert into emp_dim_scd1 values(12,Ravi',1500);
select * from emp_dim_scd1;
Instruction :
 Create employ1, emp_dim_scd1 table in oracle_xe.
 Using Spoon, include table input connect employ1 table,
 insert/update tag include emp_dim_scd1 dimension table, run the transformation and execute the result
 Insert into employ1(13,Rajaa,2400); record in the employ1 table, again execute the result in spoon
 Display emp_dim_scd1 dimension table newly inserted row details are included.Dr. Girija Narasimhan 23

More Related Content

Unit 2 - Slowly Changing Dimension Type 1 (SCD1) (insert)

  • 1. Unit 2 Slowly Changing Dimension SCD type 1 (Insert) Dr. Girija Narasimhan 1 https://www.oercommons.org/authoring/28693-etl-using-pentaho-spoon-lecture-notes-ppt-exercise/2/view https://www.oercommons.org/authoring/28550-etl-using-pentaho-spoon
  • 2. create table student_scd1(sid number(5) not null,sname varchar2(15),mark1 number(5),result varchar2(10),grade varchar2(3)); insert into student_scd1 values(11,'Ambu',89,'Pass','A'); insert into student_scd1 values(12,'Meenu',75,'Pass','B'); insert into student_scd1 values(13,'Jasica',45,Fail',D'); select * from student_scd1; create table student_dim_scd1(dim_sid number(5) not null, sname varchar2(15),mark1 number(5),result varchar2(10),grade varchar2(3)); insert into student_dim_scd1 values(11,'Ambu',89,'Pass','A'); insert into student_dim_scd1 values(12,'Meenu',75,'Pass','B'); insert into student_dim_scd1 values(13,'Jasica',45,'Fail','D'); select * from student_dim_scd1; update student_scd1 set mark1=60,grade='C',Result='Pass' where sid=13; select * from student_scd1; Dr. Girija Narasimhan 2
  • 5. Drag and place the table input Dr. Girija Narasimhan 5
  • 6. Right click the mouse in Table input and select Edit step Dr. Girija Narasimhan 6
  • 7. Select New get Database connection details Computer name in the property of the system Click the Test Button Database name is xe, Database user name hr and password of the user hr 13 4 2 5 Dr. Girija Narasimhan 7
  • 9. Preview Data Dr. Girija Narasimhan 9
  • 23. Exercise: create table employ1(eid number(5) not null,ename varchar2(15),salary number(5)); insert into employ1 values(1001,'Alaa',1800) insert into employ1 values(12,Ravi',1500); select * from employ1; create table emp_dim_scd1(dim_eid number(5) not null, ename varchar2(15),salary number(5)); insert into emp_dim_scd1 values(1001,'Alaa',1800) insert into emp_dim_scd1 values(12,Ravi',1500); select * from emp_dim_scd1; Instruction : Create employ1, emp_dim_scd1 table in oracle_xe. Using Spoon, include table input connect employ1 table, insert/update tag include emp_dim_scd1 dimension table, run the transformation and execute the result Insert into employ1(13,Rajaa,2400); record in the employ1 table, again execute the result in spoon Display emp_dim_scd1 dimension table newly inserted row details are included.Dr. Girija Narasimhan 23