var sidebar_align = 'right';
var content_container_margin = parseInt('290px');
var sidebar_width = parseInt('270px');
Relational Design for storing presently selected information
I'm trying to store some information that describes which of a list is currently selected by the user.
Table: collections (a collection can have only one name)
Table: books (a book can have only one name)
Table: users_collections (one user can have many collections, but a collection can have only one user)
Table: books_collections (a book can belong to many collections)
I want to store which collection and book a user is currently viewing, and am not sure how to properly store it:
New table called currentselections:
Two new tables, currentBook & currentCollection:
currentcollectionID or currentBookID
Option 1 seems attractive to me, but I can't seem to find any good advice on this in any database design resources.
Last edited by TravisJ; 08-20-07 at 15:54.
Reason: title mistake
the difference between 1. and 2. is the difference between 3NF and 5NF (or is it 6NF?) and i don't think it matters
can a user look at a book that isn't in a collection? can a user look at a collection but not at a book in that collection?
it looks like user-book is 1-to-0-or-1, and user-collection is also 1-to-0-or-1, in other words, either is optional
so i would use 1. and allow NULLs