Postgresql – What should be the relationship between an adminstrators table and users table

postgresql

If admin account can create user accounts, does this mean that the relationship between the admin table and the users table is:

ADMIN OneToMany Users

For example, in my project:
enter image description here

A person with the privilege adminstrateur account, can create accounts with the privilege technicien_sav. Obviously, each kind of privilege grants the one who has it access to different parts of the app.
However, I do not see the SQL relationship necessary for the overall functioning of my app. I.e: The administrateur can create technicien_sav accounts even without the existence of the relationship between the two.
What do you think?
PS: It's been years since I've worked with SQL databases, I hope the question is not too naive.

Best Answer

From what I can tell from your image (please post ddl instead), there is no relationship between adminstrateur and technicien_sav. If you add an attribute created_by or administered_by in technicien_sav, there would be a relationship. Since this attribute most likely is not part of the key for tech... , it would be referred to as a non-identifying relationship. Example:

CREATE TABLE adminstrateur
( adminstrateur_id ... not null primary key
, fullname ...
, ...
);

CREATE TABLE technicien_sav
( technicien_sav_id ... not null primary key
, ...
, adminstrateur_id ... not null
      references adminstrateur (adminstrateur_id)
);

I prefer using the same attribute name throughout the model, names like id, name, etc are IMO to vague. Even better is to use names from the domain of discourse, but I have no idea what the might be in your case.