Hi everyone,
I have a question regarding database design, I hope that this is
appropriate for the list. Let's say that I have the following tables:
clients (id,name)
contacts (id, name, phone, client_id (FK))
companies (id, name)
employees (id, name, phone, company_id (FK))
logins (id, username, password)
What's the best way to connect contacts and employees to the logins
table? I've thought of duplicating the username & password fields
into both the contacts and employees tables, adding both contact_id
and employee_id foreign keys to the logins table, and adding login_id
foreign keys to the contacts and employees tables, but none of these
solutions seem very smart.
Thanks,
Marc