Re: Cardinality "highly unusual"

From: Hugo Kornelis <hugo_at_pe_NO_rFact.in_SPAM_fo>
Date: Tue, 15 Feb 2005 11:34:01 +0100
Message-ID: <cnj3115phipl15dd9glhg3h3q80u3besv6_at_4ax.com>


On Tue, 15 Feb 2005 17:11:31 +0700, Matt M wrote:

(snip)
>On to cardinality. If each book can be associated with up to one order, and
>each order contains at least one book, the cardinality should be zero-or-one
>to one-or-more. This is where I have a problem. The tool I'm using to model
>the database, MS Visio EA, complains that:
>
>'Order_Book_FK1': Cardinality 'Zero-or-One-to-One-or-More' or
>'Zero-or-One-to-Exactly-N' is highly unusual.
>
>Is this true? If so, how should I model the book/order relationship, bearing
>in mind that each book can be associated with at most one order?

Hi Matt,

Based on your description, you've chosen the right cardinality. I don't know if the statement of MS Visio EA about this type of cardinality being rare is true or not. In any case, I wouldn't worry about it. It doesn't sound like an error message - more like a warning. Consider it a reminder: the program tells you "this is unusual - you might want to double-check if you didn't make an error here".

>I should add that the text I'm working from models the relationship using a
>composite entity, BookOrder. This has a 1:1 identifying relationship with
>Book, and a m:1 identifying relationship with Order. Cardinality is not
>specified. However, if I try to model this relationship, Visio complains
>that:
>
>'Book_BookOrder_FK1' : Relationship has a cardinality of either zero-or-one
>or exactly-one, yet the child columns form part of a key.
>
>It seems, therefore, that the solution given in the text also has its
>problems.

Is the text you're working from specifically written for your situation (rare books, that are unique and can therefor be sold only once). I'm asking because the solution from the book is exactly what a reular book store would use (though I'd personally prefer to call the table "Titles" instead of "Books" in a regular book store). The BookOrder table is used to store the many-to-many relationship between Order and Book (title), since in a regular book, each order has one or more books and each title can be sold in zero or more orders.

Best, Hugo

-- 

(Remove _NO_ and _SPAM_ to get my e-mail address)
Received on Tue Feb 15 2005 - 11:34:01 CET

Original text of this message