FACT_TABLE DESIGNING

  • create table master1

    (

    ID1 int primary key,

    sal1 int

    )

    create table master2

    (

    ID2 int primary key,

    sal2 int

    )

    i would like to know how we will write SQl Query for creating fact table that will contain

    foreign keys(id1,id2) and metric values (sal1,sal2,bal,bal2) from both the tables

  • Is sal1 means salary then the tables you have just created are fact tables.

    A dimension is a set of data on which you want the axis to be sliced on

    The fact is the data on which you want to perform aggregations based on the above dimensions.

    Jayanth Kurup[/url]

  • Here i didn't mentioned varchar data type values for better understanding purpose wat i mentioned are dimension tables and here i need fact table that contain metric values of two tables along with foreign keys.

  • There needs to be more details to answer your question, here is an example of what a dim table looks like and a fact table looks like.

    A dim table such as

    Dim_Customer (

    customerid int primary key ,

    Customer name varchar(10)

    CustomerDOB datetime )

    and Dim_productDetails (

    ProdDetails_id int primary key,

    ProdDetails varchar(200)

    )

    Dim_dateKey (

    datekey int,

    date datetime,

    Year char(4),

    Month char(2)

    )

    Fc_Customer_Prod(

    customerid int int,

    ProdDetails_id int,

    Datekey int

    Salescount int)

    where sales count is the actual measure on which you will be reporting.

    Jayanth Kurup[/url]

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply