3
having the tables:
- Companies
- Customers
- empresa_id: foreign key
- Sales
- cliente_id: foreign key
and the relationships are:
- Companies and Clients => 1:N
- Customers and Sales => 1:N
Considering that I will need to list all company sales, it is worth creating a second foreign key in the sales table so I can do:
SELECT * FROM `vendas` WHERE `empresa_id` = 'x'
It depends on the necessity of the project. If you need to filter the sales by companies, you should put.
– Jorge.M