Forum Discussion

Doharaquax's avatar
Doharaquax
Frequent Visitor
3 years ago
Solved

Correct data model

Good day,   I need advice on how to solve this situation. I have "Job" tables from the ERP system that contain individual jobs. This table has dozens of new items every day. I also have a table "Ca...
  • AmiraBedh's avatar
    3 years ago

    From my point of view, it is appropriate to specify the "Job" table as a dimensional table,
    even though you will have new items which can be added to it all the time. Having dimension tables that are updated frequently with new records is known as a Type 2 dimension,
    where each change to a dimension attribute creates a new record in the dimension table.
    In your case, the "Job" table can be a Type 2 dimension, where each new job added to the table creates a new record with a unique identifier,
    and any changes to the attributes of an existing job create a new record with a new version identifier.
    Your fact table "CalcProcessCost" would then have a foreign key reference to the dimension table using the unique identifier of the job.

    The cardinality of the relationship between the "Job" table and the "CalcProcessCost" table is 1:N, which means that each job can have multiple calculation items associated with it. Therefore, the fact table "CalcProcessCost" would have a foreign key reference to the "Job" dimension table.