If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > MySQL > Assistance on DB Design

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 02-17-05, 05:59
coneofsilenc coneofsilenc is offline
Registered User
 
Join Date: Feb 2005
Posts: 1
Assistance on DB Design

Hi All.
I was wondering whether someone could assist me.
I have a set of users (all with unique usernames)
For each user, there are a set of products that they view and the price of these products varies depending upon the amount they order. The prices on the products varies between users.

So my view would look something like this (assuming userA has signed in)

quantity product1 product2 product3 product4
1 5.20 3.29 4.99 3.99
2 3.99 3.99 9.22 9.20

and obviously userB would have the similar view but with the prices being different - or the same, depending upon the distributors decision.
I have created one table called users which contains the user details, but I suspect I would need a Foreign Key or some join to ensure that when userA signed in, they would see only the prices applicable to them - not userB's.
Reply With Quote
  #2 (permalink)  
Old 02-17-05, 06:48
dimis2500 dimis2500 is offline
Registered User
 
Join Date: Jan 2005
Posts: 362
Foreign Key

The primary key of table users will be the foreign key for the product prices table, think if products are the same for all to make a products table that the primary key is foreign key for the prices table so a value per product per user
dimis
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On