MySQL Forums
Forum List  »  Data Warehouse

Re: Large Database Question
Posted by: Rick James
Date: February 13, 2010 01:45AM

A 200-page book will have the title repeated 200 times? Not cool.

Let's look at the concepts you have --
"Page" -- book_id, page_num, page_hash, page_missing, ...
"Book" (a group of pages bound together) -- book_id, #pages, title, volume_id (NULLable), sequence_in_vol, ...
"Volume" (a group of books) -- volume_id, #books, title, ...

Each of those 3 tables would have an ID (probably MEDIUMINT UNSIGNED AUTO_INCREMENT). OTOH, Page might have PRIMARY KEY(book_id, page_num)

Book can stand alone, or be part of a Volume, hence the optional volume_id
DateOfPublish -- Some Volumes are slowly published, some are published all at once. So maybe it needs to be both places.
Begin_Book, Is*Volume go away.

(I used to think of Volume and Book to have the opposite meanings??)

'Normalization' like this leads to JOINing to put things back together, but avoids lots of unnecessary duplication, disk space, and possibility of inconsistencies.

Options: ReplyQuote


Subject
Views
Written By
Posted
8235
February 10, 2010 09:30PM
4744
February 11, 2010 10:27PM
3843
February 12, 2010 08:39AM
3982
February 12, 2010 06:23PM
3824
February 12, 2010 06:33PM
Re: Large Database Question
4046
February 13, 2010 01:45AM
3918
February 13, 2010 10:40AM
3717
February 13, 2010 03:38PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.