views:

44

answers:

1

I am trying to create a database design and need some help. Diagram is displayed below. The database is for an address book attached to a e commerce site. Its coded in php and uses a mysql database.

See my diagram below - I think I have solved my problem but I want to know is this a good way to do it?

This is what I would like to do:

A person - They can be a customer (optional)
They can be an employee of a business (optional)

A business -
The can be a customer (optional)

The problem is that Im not sure how to do this as mysql doesn't like these relationships.

alt text

A: 

I've never been a big fan of using "id" as a column name, but the relationships seem sound. What do you mean when you say "MySQL doesn't like these relationships."?

Why don't you have a relationship between contacts.business_addr_rel and your businesses table?

James