July 22, 2011 at 6:22 am
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
July 22, 2011 at 6:24 am
July 22, 2011 at 7:09 am
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.
July 26, 2011 at 3:43 am
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.
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply