[thelist] sql/table design question

rudy r937 at interlog.com
Tue Feb 18 09:42:01 CST 2003


> bookID
> bookTitle
> bookNotes
> bookRelatedTo (here is where I would list the bookIDs that match)

a "list" of ids in a single field is dangerous, unless you are really sure
you know what you're doing with this design (it is not even in 1st normal
form)

the better design is a separate table, a "relationship" table, which
consists of just two columns:

 bookID1
 bookID2

(yes, there is no autonumber pk; the pk is the combination of these two
columns)

there is a wee design consideration here -- if book A is related to book B,
does this automatically imply that book B is related to book A?

modify the name of the relationship to "mentions" to see that it is not
necessarily a two-way street

if book A mentions book B, that does not imply that book B mentions book A

change the relationship to "is similar to" or "you might also be interested
in purchasing" and then of course it just might be bidirectional

interestingly enough, both situations are modelled with the same
relationship table


did i answer your question?


rudy




More information about the thelist mailing list