Junk Dimension Flashcards
1
Q
Alter table to add a JUNKID
A
Alter table xxxDIM add (junkID number(2))
2
Q
Create a Junk dimension
A
CREATE TABLE JunkDim AS SELECT DISTINCT a, b, c, d from dw.xxx
3
Q
Create a tempfact table
A
Create table tempfact as select a, b, c, d from dw.xxx
4
Q
Add junkid to tempfact
A
Alter table tempfact add (junkid num(2))
5
Q
Set sequence to tempfact
A
Update tempfact tf set tf.junkID = (select j. junkID from junkDIM j where j. aaa = tf.aaa and j. bbb = tf. bbb and j. ccc = tf. ccc and j. ddd = tf. ddd)
6
Q
Create sequence for junkDIM
A
Create sequence junk.seq_id start with 1 increment by 1 maxvalue 99999999 minvalue 1 nocycle
7
Q
Update junkDIM with the ID set to sequence ID
A
update junkDIM set junkID = junk.seq_id.nextval