Question

I have tried to search online on how to interpret these ternary relationships but haven't found any clear answer. Since I don't understand how to interpret it I am having trouble changing it into relations as well. In an example like this:

enter image description here

How exactly would I interpret this? For instance:

The line with an arrow going into Works_in3 from the Employee entity, is that pointing to the Departments entity or the Locations entity? So is it implying that an Employee can only work in one department or is it implying that an employee can only work in one location or does it imply both?

Was it helpful?

Solution

This kind of graphical representation is not one I use, so I may have to guess a bit, specially for the small arrow you can see between employees and works_in. I think you can read it as a 0,1 relation.

You can implement this model over 4 tables, like this : (#PK / ~FK)

employees(#ssn, name, lot)
departments(#did, dname, dudget)
locations(#address, capacity)
works_in(#ssn, ~did, ~address, since)

OTHER TIPS

This looks to me that an employee works in at department at a location since a point in time. I don’t recognise the diagram type as an ERD so I can’t tell what type of relationships they are but I expect that they are one to many. i.e. the works_in3 table is a link table to facilitate a many to many relationship of employee and department. As for location I expect this is where the employee worked in this department, again representing a many to many relationships, as one location could house many employees performing many roles for departments. But that’s just my opinion.

From looking at your image, I would interpret the following:

First, to answer your question, the arrow should only be pointing to the works_in3 table. If it was pointing to the department table it should go around works.

Table-field relationships:

Employee table: one to one relationship between ssn - name - lot (not sure what this field really is.) Key field seems to be ssn.

Works-in3 - one to many relationship between employee identifier (likely ssn) and since (guessing there is a department name or number in there somewhere.)

Locations: one to many relationship between works-in3 (many locations) and location table (one address, one capacity on each location.) Address is key field(?) - I question that because address isn't a good key, I'm guessing there is some sort of location identifier.

Department: one to many relationship between department (did seems to be key field) and works-in3.

Table-table relationships: Since only Employees -> works_in3 has an arrow, then I believe that there is a one to many relationship between employee (1 employee) and works_in3 (many potential entries possible for each employee depending on job(s) held.)

So, for each employee (always only 1 employee record) there is a current works_in3 record with since as the identifier. The other data in the record is from department (details) and location (details.) Each employee can have many works_in3 records showing work history.

Licensed under: CC-BY-SA with attribution
Not affiliated with dba.stackexchange
scroll top