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-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_level) this

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,

Table which can reference a number of other tables

2010-07-21 Thread Marc Guay
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,

Re: Table which can reference a number of other tables

2010-07-21 Thread Nguyen Manh Cuong
table with some contact_id If group_type is employees, then query to the employees table with some employee_id - Original Message - From: Marc Guay marc.g...@gmail.com To: mysql@lists.mysql.com Sent: Thursday, July 22, 2010 12:44:17 AM Subject: Table which can reference a number of other