0% found this document useful (0 votes)
83 views2 pages

Fact Table Timeid Productid Customerid Unit Sold

Dimension tables provide contextual information to help analyze facts stored in fact tables. Fact tables contain measurements and foreign keys linking to dimension tables. Dimension tables contain attributes like keys and descriptive attributes. Together, fact and dimension tables allow querying and analyzing measured data in context.

Uploaded by

subash pradhan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
83 views2 pages

Fact Table Timeid Productid Customerid Unit Sold

Dimension tables provide contextual information to help analyze facts stored in fact tables. Fact tables contain measurements and foreign keys linking to dimension tables. Dimension tables contain attributes like keys and descriptive attributes. Together, fact and dimension tables allow querying and analyzing measured data in context.

Uploaded by

subash pradhan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

Dimension Table vs Fact Table

Fact Dimension
fact tables provide the measurement of an Dimension tables provide descriptive or contextual
enterprise information for the measurement of a fact table
fact table contains a foreign key, measurements, A dimension table contains a surrogate key,
and degenerated dimensions natural key, and a set of attributes
fact tables is that fact tables hold the data we the dimension tables hold the information
want to analyze necessary to allow us to query it

Fact table

TimeID ProductID CustomerID Unit Sold


4 17 2 1
8 21 3 2
8 4 1 1

Now we can add a dimension table about customers:

Dimension table: Customers

Customer Nam Gend Inco Educati Regio


ID e er me on n
Bria
1 n M 2 3 4
Edge
Fred
2 Smit M 3 5 1
h
Sally
3 Jone F 1 7 3
s

Q- How to know the index of a table?

Execute sp_helpindex <table name>

- A cluster index determines the physical order of data in a table


- A table can have only one cluster index
- A cluster index contains multiple columns, if a cluster index contain multiple columns and we are
applying index more than one column, we called it composite index.
- As column can have only one cluster index, but we can create multiple index on multiple
columns with single index key.
- Create cluster index <Index Name> on <table name> (col1 desc, col2 asc)
- Create noncluster index <Index Name> on <table name> (col1 desc, col2 asc)

Cluster Non Cluster


One cluster index per table More than one non-clusterindex per table
Cluster index is faster than non-cluster It is less faster
No extra table space, as it determines storage Extra table space. Non cluster index stored
order of rows in the table separately from the table
Actual organized data, like example phone It always point to actual data, like back side
book book index

-
-
-

You might also like