-2

Let's say that works-in is a relationship between entity types Employee and Department and the cardinality is many to one. Does total participation of Employee in the works-in relationship in other words mean that if I ever put an employee in my database, I must provide a Department that the employee works in? In mathematical terms: Employee is put in a table <=> Employee has associated Department. Can someone explain this in simple terms involving the sets of the entities and that of the relationship? Thanks.

qwerty_so
  • 35,448
  • 8
  • 62
  • 86
LearningMath
  • 851
  • 4
  • 15
  • 38

1 Answers1

3

You're question isn't entirely clear based on the information you gave.

For example: if an employee must have a department and each department must have an employee then it's total participation on both sides. (You cannot delete a department if it has an employee. And cannot delete an employee if it has a department with no other employees). Basically this means that those foreign keys cannot be null

However, if a department must have an employee but an employee doesnt have to have a department then the department has total participation and the employee has partial participation. Basically this means these foreign keys can be set to null.

  • I was referring to the situation where Employee works-in Department, and the employee has total participation meaning that for every employee i must have an associated department (every employee must participate in some pair (employee, department)). And the relationship is many to one, meaning that many employees can work in one department. Also, the department has a partial participation, meaning that a department may or may not participate in a pair (employee,department)). Does this mean: I add an employee in a table <=> Employee is connected to a Department (I must add department too)? – LearningMath Nov 26 '18 at 03:35
  • 1
    @LearningMath, please update your question instead of putting the clarification in a comment. – Geert Bellekens Nov 26 '18 at 06:42