Search code examples
sql-servert-sqlerd

SQL Server: ternary relationship


I'm trying to implement the following scenario:

  • Employee can work in different positions at the same time
  • Each position is connected to a project

Note that some positions are not necessarily connected to a project (employee manager no project)

I have made a diagram to get a better view of what I need to make. See below for the diagram. From the diagram and searching on the internet. I found out that it's probably a ternary relationship. But I can't find out, how I can implement this. I'm using SQL Server in Visual Studio 2015 and use T-SQL create statements.

How can I implement this in my SQL Server database?

Ternary relationship


Solution

  • If each position can only be associated with at most one project, then

    enter image description here