Data model, many-to-many and one-to-many relation - data-modeling

So we are developing a KPI and Initiative management system for a client.
In the image you can see the data model we've built based on the client's needs.
Basically this is the hierarchy of our data model: Strategic Objective linked to one entity > KPI > Initiative
Recently we've discovered from the customer that the strategic objective and KPI could be shared between more than one entity, but in the end for each entity there is a different Initiative.
I don't know how to reflect this in the data model. But I came up with three possible solutions:
1- Breaking down the Strategic Objective and Entity relation from one-to-many to many-to-many. And also the Strategic Objective and KPI relation to many-to-many, but this does not solve my problem. As in the end I want to model that for example SO1 is shared between entity1 and entity2, so is the KPI but not the Initiative.
2- EntityOwner table, that basically maps the Strategic Objective or KPI or Initiative to the entity directly.
3- Instead of mapping the entity to the strategic objective, we map it to the Initiative.
The Datamodel

Why not remove the relation between the KPI and Initiative and instead create one between Entity and Initiative?
Such model resembles the fact that KPIs seem to be in the domain of business performance while initiatives lie more on the side of programmes / projects office. In other words a business creates initiatives to satisfy strategic objectives not KPIs. KPIs are for visibility.
I would also query whether Strategic Objectives should have direct relationship with Entities, or whether there should be relationship SO -
- INITIATIVE -- ENTITY.

Related

EDR M:N relationship with multiple dependencies

I am in process of designing a reporting tool. the Interface will be C# with backend database. The tool will allow to enter and edit data through an interface and save it to the Database. Additionally, it will provide specific reports, based on the data retrieved from DB.
Currently, I have been trying to solve a M:N relationship in for my DB tables.
The tool lets a user to enter daily Item amounts (Steel and Mesh) based on a Project. I have solved the M:N relationship in the following diagram but I am not sure if this is actually possible and whether I need to break down the daily stats table further, due to a composite key containing 4 PKs from other tables. This is the current diagram i got.
I am wondering whether the diagram has solved the M:N relationship correctly and whether there is a better way to utilise the date table.

3-Way Relation or Relation with Relation in Laravel?

I'm puzzling over how to set up this relationship in Laravel, (I'm converting a legacy app):
I have Repair Shops, which provide different types of repairs, on different brands of vehicles.
For example, Shop A might repair Brakes but not Exhaust Systems for Ford vehicles. Shops are required to say what services they provide, (Exhaust repair), but adding a brand is optional. I have Shop, Service, and Brand tables in the DB. Shop and Service have a belongsToMany relationship using the provides_service pivot table. In the legacy system I have a 3-way pivot table to specify what Services can be done to each Brand in each Shop.
Laravel doesn't seem to do 3-way relationships well, (or does it? If so, point me there!). So, I feel like it would make sense to create a belongsToMany between the provides_service relation and the Brand. So, is there a way to set up a relationship between a Model and another Relationship in Laravel, or do I have to create a ProvidesService model? Creating a ProvidesService model seems wasteful, but I'm not sure what else to do here.

Creating Db relationships Entity Framework

I have a new website project (part portfolio, part self-teaching) for creating and storing recipes. I've sketched out a number of tables that I think will serve as a starting point. I'm not certain the best way to relate them to each other along best practices with Entity Framework database first design. Once I have good relationships set up I would like to use this in an ASP.NET MVC application that I am also building.
Recipes - One recipe contains many steps, one recipe contains many ingredients, one recipe has one meal category
RecipeSteps
Ingredients - One ingredient belongs to one food group, many ingredients belong to many recipes and recipe steps
Food Groups - One to many with ingredients
Meal Categories - One to many with recipes
Measures
I'm using SQL DBM beta to create diagrams of the relationships
The PKs right now are datatype bigint, I don't know if this is a good idea or not.
Please reference the link below for a diagram.
https://sqldbm.com/Project/SQLServer/Share/CWVyMDaQBmjz2hb_hWrslw

Data warehouse modeling - consistency between two fact tables

I have some trouble to design my data warehouse. Here's the context :
Financial people register our deals and report a financial snapshot every month. When they register new deals, they also indicates some information like which equipment is sold, at which customer, etc. (our dimensions).
Project managers add additionnal data to these deals with milestones information (startup project date, customer acceptance date, etc.), also on a monthly basis.
Finance will only use finance information, Project Manager could use both type of information.
Based on this information, I have many possible scenarios, which is the best ?
1st scenario : star schema
In this scenario, I have two separate tables for Finance and Project management. But the thing is that I will have to duplicate reference to dimensions (equipment, customer, etc.) as it is Finance that declare deals and that information have to stay consistant for a same deal.
First Scenario Schema
2nd scenario : one common table
As we have the same granularity (both are monthly snapshot), we could merge Finance and Project management information in a single table and proposes two views to the users. But I fear that it will become a mess (different enterprise function in a single table...).
3nd scenario : snowflake schema
We also could add a "Deal" table, containing all references to other dimensions (customer, equipment, etc.).
Third Scenario Schema
Thanks in advice for any usefull advice !

How to visualize relation between objects in a database?

I have a database which I want to visualize in some kind of tool. Let me explain the basic:
Company A does business with Transport Company A and Transport Company B.
Transport Company A does business with Company A, Company B and Company C.
Company C does business with Transport Company A and Transport Company B.
As you can see every Company does business with different Transport Companies and vice versa. These relationships can be implemented in a database, and when drawing a visual model on paper this is also very easy.
Of course the model should contain hundreds of Companies and Transport Companies. So I want to have a visualizing tool, where a overview of these relations can be displayed.
My question is which tools can be used for realizing this?
I think you want to look at Microsoft Visio (get the 2010 version. 2013 is almost unusable from a database standpoint).
But if i am assuming correctly, you want to create a table per company. Don't do this! this can cause redundancy and data integrity problems. you want to create just one table and create what is called a unary many-to-many relationship. This is relationship that can be translated to many different rows can relate to many rows in the same table. I won't go into more detail unless you want me to, as i spent a week or 2 in my Database Design course last month just on many-to-many relationships and gets kinda complicated.

Resources