Hi guys,

If there is this scenario where the part must be supplied at least two or more suppliers, how should i represent it in my er model?

supplier 2..* supplies 0..* parts

Is this the correct way of doing? I'm using uml notation for my er model.

Recommended Answers

All 4 Replies

Here is what I recommend

supplier 1..* supplies 1..* parts

Since each supply will be for a part, you have to have at least one supply.

Agree with timothy, don't let that 2 confuse you, its place is not in an er diagram

thanks for the reply.

How do i implement this constraint in my database: that each part must be supplied by at least two different suppliers?

that constraint won't be in the database either, it will be in the query

you can do a select on the parts you need, join to the supplies and find out how many suppliers offer it, if 2 then you can allow ordering or whatever it is

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.