Jump to content

Recommended Posts

Hi all,

Am working on a database project for my company and have pretty much everything set up.  However I am unsure whether a relationship is needed here.  Let me explain :

We have different types of customers and have a table  holding these that is related to the customers table.  When a customer makes a sale the cust ID is related to that sale carrying with it the customer type.  Then our products are given as a different price depending on their type.  Do I need a relationship between the Cutomers table, value type to the Product table, value type?

Does this make sense, the Sales table is connected to the Product table via Purchase Order key.
Link to comment
https://forums.phpfreaks.com/topic/18530-relationships-question/
Share on other sites

  • 3 weeks later...
I'd set the relationship to the cust_type table type field. IF you print a price list, say, you need that one.

[pre]
cust_type    customer    sales        product      price
----------  ---------    --------      ---------    ---------
cust_type -+  cust_id -+  purch_ord  +- prod_id  --- prod_id
type_desc  |  name    |  prod_id  -+  prod_desc  +- cust_type
          +- type    +- cust_id                  |  price
          |                                      |
          +---------------------------------------+[/pre]
Link to comment
https://forums.phpfreaks.com/topic/18530-relationships-question/#findComment-88758
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.