Re: Table which can reference a number of other tables

2010-07-26 Thread Geert-Jan Brits
Am I correct in assuming that "Industries" can be seen as some sort of "super contact-group" in your application? If so, you could merge "Contact group" and "Industries" --> "Contact group" Contact Groups -- id name parent_id (FK) type ("industry_level, "sub_level", "some_other_lev

Re: Table which can reference a number of other tables

2010-07-26 Thread Marc Guay
I keep running into problems like this and have another example of it that might be clearer. I have 4 tables, Newsletters, Contacts, Industries, and Contact Groups. We send Newsletters to Contacts, either grouped by Industry or Contact Group. Contact Groups must be associated with an Industry.

Re: Table which can reference a number of other tables

2010-07-22 Thread Shawn Green (MySQL)
On 7/21/2010 1:44 PM, Marc Guay wrote: 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, pho

Re: Table which can reference a number of other tables

2010-07-21 Thread Nguyen Manh Cuong
Hi Marc, - If you use this database for some website, the solution is: clients (id,name) contacts (id, name, phone, client_id (FK), username, password) companies (id, name) employees (id, name, phone, company_id (FK), username, password) logins table will be removed Then you must build web int