Page 1 of 1

Fact vs Dimension

Posted: Tue Apr 03, 2012 10:54 pm
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.

Re: Fact vs Dimension

Posted: Wed Apr 04, 2012 1:02 am
by SURA
So what do you think?

FACT / DIM ?

DS User

Posted: Wed Apr 04, 2012 4:50 am
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..!!

Re: Fact vs Dimension

Posted: Wed Apr 04, 2012 7:43 am
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.

Posted: Wed Apr 04, 2012 7:48 am
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.

Posted: Wed Apr 04, 2012 8:36 am
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.

Posted: Wed Apr 04, 2012 1:55 pm
by qt_ky
Search on Data Warehouse. If you're not doing DW work, then it will not apply so much...

Posted: Wed Apr 04, 2012 3:11 pm
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).

Posted: Mon Apr 09, 2012 1:26 am
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?

Posted: Mon Apr 09, 2012 7:08 am
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.

Posted: Mon Apr 09, 2012 12:57 pm
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.