note_id note_type note_type_id note_content
NOTE_TYPE可以是'book'或'article';如果note_type为'book',则NOTE_TYPE_ID是book_id的FK;如果note_type为'article',则NOTE_TYPE_ID是article id。现在我开始怀疑这是否是正确(或最佳规范化)的设计。另一种方法是使用5个表: books / articles / notes / book_notes / article_notes
这样我就可以分别保留书籍笔记和文章笔记,列如下:
'notes' { note_id, note_content } 'book_notes' { book_id, note_id } 'article_notes' { articel_id, note_id }
哪一个是正确或更好的呢?