# Dimensional Modelling

Dimensional Modeling (DM) is a data structure technique optimized for data storage in a Data warehouse. Dimensional modeling aims to optimize the database for faster data retrieval. The concept of Dimensional Modeling was developed by Ralph Kimball and consisted of "fact" and "dimension" tables.

### Dimension Table

Dimension provides the context surrounding a business process event; they give who, what, and where of a fact. In the Sales business process, for the fact quarterly sales number, dimensions would be

```
Who – Customer Names
Where – Location
What – Product Name
```

They are joined to Fact tables via a foreign key.

Dimensions offer descriptive characteristics of the facts with the help of their attributes.

<figure><img src="https://2629735788-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F3G2NQEHaUSzehWzaKvXK%2Fuploads%2FG3b4tVnMaYvCXIQxTAMW%2Fdm_01.png?alt=media&#x26;token=99c274bc-9e96-43b7-b994-6e725507f28e" alt=""><figcaption><p>Src: www.guru99.com</p></figcaption></figure>

<figure><img src="https://2629735788-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F3G2NQEHaUSzehWzaKvXK%2Fuploads%2FH1AahzVLHRBeJOErdSDR%2Fdm_02.png?alt=media&#x26;token=14b39b6a-bda3-424f-a01f-b6663719424d" alt=""><figcaption><p>Src: www.guru99.com</p></figcaption></figure>

### Fact Table

It contains Measurements, metrics, and facts about a business process, the primary table in dimension modeling.

A Fact Table contains

```
Measurements/facts
Foreign key to the dimension table
```

<figure><img src="https://2629735788-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F3G2NQEHaUSzehWzaKvXK%2Fuploads%2FOOBhpnWrdaqfjygODHOS%2Fdm_03.png?alt=media&#x26;token=e1240ada-4225-404b-92dc-6f15f919871a" alt=""><figcaption><p>Src: www.guru99.com</p></figcaption></figure>
