| Oracle FAQ | Your Portal to the Oracle Knowledge Grid | |
Home -> Community -> Usenet -> c.d.o.server -> Re: oracle DB design question
I think I would solve it like this:
Author
Book
Reader
Then you have several many-to-many relationships to handle. You handle them with a separate table for each many-to-many relationship:
Book_Author
Reader_Author
Reader_book
I think you might be ok to join the Reader_author & reader_books together:
Reader_book
Just my 2-cents worth....
-Frank
In article <6qvhdf$pq1$1_at_nnrp1.dejanews.com>,
ziv103_at_my-dejanews.com wrote:
> hello,
> If I have an entity (for instance a "book") which is ALWAYS related
> to another entity (for instance an "author"). I have one decoding table
> for "authors" (numeric sequential code + description). Which way is
> preferred when designing the "books" table:
> 1. *author_code *book_code au_name ... (2 primary keys)
> 2. *book_code bk_name author_code ... (1 primary key and FK+index
> on author_code)
> I am asking because suppose there is a third table containing
> information on the entity "reader" whereas each reader likes to read
> books by a specific author. readers table would look like this:
> (*reader_code reader_name author_code(FK) age....)
> If i have a table containg the books each
> reader has read, where i want to verify through it, the book is by the
> author he likes. Should this table have:
> 1. three PK for solution (1) thus verifying integrity with a FK.
> (*author_code *book_code *reader_code)
> 2. two PK for solution (2) thus verifying integrity with say a trigger
> (*reader_code *book_code)
>
>
-----== Posted via Deja News, The Leader in Internet Discussion ==----- http://www.dejanews.com/rg_mkgrp.xp Create Your Own Free Member Forum Received on Thu Aug 13 1998 - 19:33:48 CDT
![]() |
![]() |