Hello. There is a database, and for it was an ER-chart. Do I understand correctly that all communications will be one to one?

Nr: one user can have only one status (or level of rights), or one application can have only one life cycle

enter image description here

  • And why do you need the table "Life Cycles"? it only makes sense if several applications have the same life cycle. Moreover, the fields in the life cycles very much resemble the status of the application, I would at least call it that. If these fields are not expressed in one status, then why not keep them directly in the application? - Mike
  • And the fact that one department can have many users, do not count? - D-side

1 answer 1

“Theoretically” is correct, the situation is when one status - one user can exist, for example, when you have only one user in the database and one status :). This relationship is also useful if we have a BIG table with many fields, most of which we rarely need, and we put them in a separate table. But more often, in practice, the one-to-many relationship is much more useful, that is, when one user has one status, and one status has many users.

  • Ie, change the type of connection in the table "Users statuses", as well as in the "Departments" table. Did I understand you correctly? Changed the initial image - ExzoTikFruiT
  • Or, if you think about it, then for all connections, except for the life cycle, you need to change the type of connection. Right? - ExzoTikFruiT
  • @ExzoTikFruiT, I can’t tell you “how to”, since I don’t know your task, but the 1-1 ratio is usually exotic. And yes, still a little advice, take the relationship not as a "connection", but as a "restriction" (en. CONSTRAINT) - this will save you from many mistakes. - Mirdin
  • I made an analogy with users and status, and it turned out like this: One user corresponds to one department, but one department corresponds to many users. Also for applications: one application corresponds to one user, but there can be many applications from one user. I could not follow this logic for the life cycle table: i.e. one life cycle strictly corresponds to one application, as well as an application can have one life cycle. True logic? - ExzoTikFruiT
  • @ExzoTikFruiT, in general, yes - Mirdin 4:44 pm