Monday, March 19, 2012

A basic question?

Hello all!,
This is probably pretty simple. I think I'm trying to hard on this, and
can't see the logic. If I have a table(products) with a productID, prodname.
And a another table called user, with UserID and name. And I add a UserID
column to my Product table. How can link the userID to the product ID. So i
f
user1 sells, apples and grapes, apple and grapes will have UserID1 matched t
o
it, just like userid2 sells Oranges, and so on. Hopethis makes sense!
Thanks!!
RudyHi Ruby
This looks like a database design issue. To reduce the redundancy,
to can create a new Table UserProducts and add UserID and ProdID to it
Ex:
User ID | Name
1 | User-1
2 | User-2
3 | User-3
ProdID | Name
1 | Apples
2 | Grapes
3 | Oranges
UserID | ProdID
1 | 1
1 | 2
3 | 3
Hope this answers the question
thanks and regards
Chandra
"Rudy" wrote:

> Hello all!,
> This is probably pretty simple. I think I'm trying to hard on this, and
> can't see the logic. If I have a table(products) with a productID, prodnam
e.
> And a another table called user, with UserID and name. And I add a UserID
> column to my Product table. How can link the userID to the product ID. So
if
> user1 sells, apples and grapes, apple and grapes will have UserID1 matched
to
> it, just like userid2 sells Oranges, and so on. Hopethis makes sense!
> Thanks!!
> Rudy|||Thank you! That does make sence. I knew I was making it more difficult tha
n
it had to be.
Thank You!!
Rudy
"Chandra" wrote:
> Hi Ruby
> This looks like a database design issue. To reduce the redundancy,
> to can create a new Table UserProducts and add UserID and ProdID to it
> Ex:
> User ID | Name
> 1 | User-1
> 2 | User-2
> 3 | User-3
> ProdID | Name
> 1 | Apples
> 2 | Grapes
> 3 | Oranges
> UserID | ProdID
> 1 | 1
> 1 | 2
> 3 | 3
> Hope this answers the question
> thanks and regards
> Chandra
>
>
> "Rudy" wrote:
>

No comments:

Post a Comment