Fact vs Dimension

A forum for discussing DataStage<sup>®</sup> basics. If you're not sure where your question goes, start here.

Moderators: chulett, rschirm, roy

Post Reply
karthi_gana
Premium Member
Premium Member
Posts: 729
Joined: Tue Apr 28, 2009 10:49 pm

Fact vs Dimension

Post by karthi_gana »

All,

Which table data will be loaded first?
how many keys can be created for Fact table?
how many keys can be created for Dimension table?

Yes...This is the interview questions...one of my friend recently faced the above questions.
Karthik
SURA
Premium Member
Premium Member
Posts: 1229
Joined: Sat Jul 14, 2007 5:16 am
Location: Sydney

Re: Fact vs Dimension

Post by SURA »

So what do you think?

FACT / DIM ?

DS User
bskumar4u
Participant
Posts: 13
Joined: Mon Feb 21, 2011 4:47 am
Location: Hyderabad

Post by bskumar4u »

Fact table:It consists of foreign Keys and Measures(mostly Numeric values)
Dimension:It provides descriptive information relating to the foreign key in a fact.
Eg:- in employee table i have ename empid sal
in manager table i have mname mid and sal

so there are two dimension table
1--> emp table contains enmae eid(PK) sal
2--> Mgr table contains mname mid(PK) sal

Fact table contains
eid(FK) mid(FK) esal and msal
usually dimension tables are loaded first then fact tables followed by aggregrator tables...
there are 2 types schema in loading them:
1. Star
2. Snow flake( dimensions r broken into sub dimensions)

PLease correct me if i'm wrong..!!
....................Shanthi
karthi_gana
Premium Member
Premium Member
Posts: 729
Joined: Tue Apr 28, 2009 10:49 pm

Re: Fact vs Dimension

Post by karthi_gana »

SURA wrote:So what do you think?

FACT / DIM ?

DS User
Fact table ? I'm sorry..i am unable to fit this concepts in my projects. i have created lot of jobs..though :(..i am little bit weak on this topic. I might have implemented this topic in my jobs without knowing them.
Karthik
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

There's no "usually" here, only one answer as one must be loaded before the other... and the relationships between the two should make that answer obvious.
-craig

"You can never have too many knives" -- Logan Nine Fingers
pandeesh
Premium Member
Premium Member
Posts: 1399
Joined: Sun Oct 24, 2010 5:15 am
Location: CHENNAI, TAMIL NADU

Post by pandeesh »

You can get a lot of info regarding Fact and Dimension by searching in "Google"..It had been discussed several times in the past .
Refer the articles by Ralph Kimball for getting more insight.
pandeeswaran
qt_ky
Premium Member
Premium Member
Posts: 2895
Joined: Wed Aug 03, 2011 6:16 am
Location: USA

Post by qt_ky »

Search on Data Warehouse. If you're not doing DW work, then it will not apply so much...
Choose a job you love, and you will never have to work a day in your life. - Confucius
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Which will be loaded first? Whichever one you choose to load first.

However, there is a right way and a wrong way. And the wrong way is highly likely to throw errors, for example if referential integrity is enforced in the database (which it should be).
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
karthi_gana
Premium Member
Premium Member
Posts: 729
Joined: Tue Apr 28, 2009 10:49 pm

Post by karthi_gana »

Dimension table must be loaded first and then the fact table should be loaded.

Ref:

http://www.information-management.com/i ... gination=1

Am I correct?
Karthik
priyadarshikunal
Premium Member
Premium Member
Posts: 1735
Joined: Thu Mar 01, 2007 5:44 am
Location: Troy, MI

Post by priyadarshikunal »

yes if there are foreign key constraints which should be there else it may create data integrity issues. This has been already mentioned in Craig's post.
Priyadarshi Kunal

Genius may have its limitations, but stupidity is not thus handicapped. :wink:
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

karthi_gana wrote:Am I correct?
Not entirely. If snowflakes exist these must be loaded even before dimensions, from the outside in.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Post Reply