In every system a Date Dimension is needed for multiple reasons and addresses multiple use business use cases.
What is Date Dimension?
Date Dimension is a table that has one record per each day, no more, no less! Depends on the period used in the business you can define start and end of the date dimension.
In this post i will post the code i use to generate a data dimension from scratch in MySQL.
Table creationÂ
Procedure to generate the Date Dimension data
Execute Procedure
I hope this help !