The database I'm designing has 3 major tables: BOOKS
, ARTICLES
, NOTES
.
Each book or article can have multiple notes, my original design was just like that, which means both notes on books and notes on articles go the 'notes' table. Here are the columns for the NOTES
table:
note_id
note_type
note_type_id
note_content
NOTE_TYPE
can be either 'book' or 'article'; NOTE_TYPE_ID
is the FK for a book_id if the note_type is 'book' OR an article id if the note_type is 'article'.
Now I start to wonder if that's the correct(or best normalized) design. An alternative approach is to use 5 tables
books / articles / notes / book_notes / article_notes
This way I can keep book notes and article notes separately, the columns are like
'notes' { note_id, note_content } 'book_notes' { book_id, note_id } 'article_notes' { articel_id, note_id }
Which one is correct or better?