Customer and Business database relationships
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 (optio开发者_开发百科nal)
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 http://dl.dropbox.com/u/1417817/diagram.png
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?
精彩评论