Smart questions
Smart answers
Smart people
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Member Login

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips now!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

Join Tek-Tips
*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

LINK TO THIS FORUM!

Add Stickiness To Your Site By Linking To This Professionally Managed Technical Forum.
Just copy and paste the
code below into your site.

Partner With Us!

"Best Of Breed" Forums Add Stickiness To Your Site
Partner Button
(Download This Button Today!)

Feedback

"...If there has ever been a justification needed for access to the net during working hours, just referring to this site should suffice. Fantastic!..."

Geography

Where in the world do Tek-Tips members come from?
technisup (Programmer)
28 Sep 07 9:32
Hi, I would like to hear ideas from you to handle the same item but from different providers in a database?

Thanks for your replies.
SkipVought (Programmer)
28 Sep 07 9:40



Hi,

Could you provide an example of data to support what you described?

Skip,

glasses When a group touring the Crest Toothpaste factory got caught in a large cooler, headlines read...
Tooth Company Freeze a Crowd!  and
Many are Cold, but Few are Frozen!tongue

technisup (Programmer)
28 Sep 07 9:48
Thanks for your reply, this would be the data example:

Product: Mountain Bike
Provider: All Stars providers
Description:.....
Value:......

Product: Mountain Bike
Provider: Bikers Ltd.
Description:.....
Value:......

And so on.
SkipVought (Programmer)
28 Sep 07 9:59




What do you mean by "handle"

For the example you just posted, show what you mean by "handle".

Skip,

glasses When a group touring the Crest Toothpaste factory got caught in a large cooler, headlines read...
Tooth Company Freeze a Crowd!  and
Many are Cold, but Few are Frozen!tongue

Crowley16 (TechnicalUser)
28 Sep 07 10:20
allow duplicates on product name and use an identity for the pk of products...

either that or a composite key, but I would generally shy away from composite keys...

--------------------
Procrastinate Now!

technisup (Programmer)
28 Sep 07 12:25
What i mean by handle is that i'm just trying to know how in a website that sales products from several and differents providers the same item from a different provider?

Thanks for trying to helping me out with it.
elsenorjose (TechnicalUser)
28 Sep 07 15:00
Well, first of all, these are not duplicate items. They are unique because each item is provided by a different vendor. It's poor database design for you to store data this way. What you need to do is store the data in tables for each entity, in this example, a product entity and a vendor or supplier entity. You would then provide IDs for each vendor and product. Queries would then join these tables on their keys. This is very basic database design. If you have Microsoft Access on your system, play around with the Northwind sample database to see how to do this. Otherwise, just Google 'database design'. You'll get a ton of results for something like this.
SkipVought (Programmer)
28 Sep 07 15:04



This is essential information for database design.

http://www.deeptraining.com/litwin/dbdesign/FundamentalsOfRelationalDatabaseDesign.aspx

Skip,

glasses When a group touring the Crest Toothpaste factory got caught in a large cooler, headlines read...
Tooth Company Freeze a Crowd!  and
Many are Cold, but Few are Frozen!tongue

elsenorjose (TechnicalUser)
28 Sep 07 15:47
I've seen that one before Skip but I took it with a grain of salt because of its emphasis on a specific product. Granted, it's a tutorial in database design and so benefits from real world examples but comments such as "Occasionally, you made (sic) need to denormalize for performance" do a disservice to the relational model. Poor performance is not necessarily the model's fault and can usually be traced to the DBMSs limitations and poor implementation of the relational model.
SkipVought (Programmer)
28 Sep 07 16:08



elsenorjose, take a breath and relax.

It's Friday.  Weekend's ahead.

Litwin, is a respected source.  There's lots of good info in the article to introduce newbies to some db design principles.

I'm on a low sodium diet, so a grain or two won't bother me.

Skip,

glasses When a group touring the Crest Toothpaste factory got caught in a large cooler, headlines read...
Tooth Company Freeze a Crowd!  and
Many are Cold, but Few are Frozen!tongue

ceh4702 (Programmer)
8 Oct 07 17:57
Well if you had part codes that had good naming conventions, then similar parts would show up next to each other.  You might want to look at uniform product codes or make the Manufacturer ID part of the part ID.  There are many different ways to do this.  One way is to hava part numbers like 00-000-000-00 where each sections stands for something.  Like tools or oil or wrenches or nuts or bolts or engine.  Then you get into the age old parent child part relationships.

Another way is to have completely random or generated part numbers with no meaning at all.  Then you have to have foreign keys to give the part meaning.  

If you do not like my post feel free to point out your opinion or my errors.

SQLSister (Programmer)
9 Oct 07 11:08
When I dealt with parts from many vendors, each vendor list was loaded by vendor and if two or more vendors had the same part, they were in the database as separate records. I had a field for vendor part-number, manufacturers part number and an indentity field that we generated and used to link all the related tables together. This way you could search by manufacturer's part number and see all the vendors and their price for the specific price or search just a specific vendor.

One thing you need to do (trust me on this as the system I'm thinking about wasn't designed this way and I had to fix it (well as much as I could we had to let the old bad data stand) is make sure to store current prices in one table and do not rely on that table to grab the prices for inventory records or sales records in the past. This is one place where you must denormalize to preserve the history of what was actually paid for the part at the time it was ordered not the current price being pulled when you call up an old sales invoice.

"NOTHING is more important in a database than integrity." ESquared

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close