I'm having trouble understanding how to create the relationship of the tables. My scenario is as below:
A parceiro
can have multiple usuários
, but a usuário
can only be linked to a parceiro
.
A usuário
can register countless pedidos
, and those pedidos
will be linked usuário
that registered and parceiro
of the user. Example:% with% a is linked to pedido
cesar in which this usuário
is linked to usuário
partner x .
To make a new parceiro
it is necessary to put the code (id) of pedido
and the data of the new request, such as: name, rg, cpf and email
In this parceiro
there is a pedido
in which it is unique and being formed by cpf-partner . In a table chave de vpn
has the vpnCode
, bytes received, sent, server ip, real ip.
A chave de vpn
has VPN
, chave de vpn
that generated it, parceiro
cpf
, pedido
rg
.
What I can not understand (I've been trying to figure out how to do it for more than a week) is how to make those relationships. Please, I need help.