I am a beginner in systems development, and I wonder if the system user table could establish relationships with other tables, such as the company table.
I am a beginner in systems development, and I wonder if the system user table could establish relationships with other tables, such as the company table.
Yes, no problem.
For example, I could associate users with companies using foreign keys:
CREATE TABLE EMPRESA (
EMPRESA_ID INT PRIMARY KEY,
-- Coloque aqui as colunas que você gostaria que EMPRESA tivesse
)
CREATE TABLE USUARIO (
USUARIO_ID INT PRIMARY KEY,
EMPRESA_ID INT FOREIGN KEY REFERENCES EMPRESA(EMPRESA_ID),
NOME VARCHAR(255),
-- Coloque aqui as colunas que você gostaria que USUARIO tivesse
);
Associations can also be made to other tables. Everything depends on the desired goal.
Note that I did not use a specific SQL syntax. The idea is just to illustrate what can be done.