Your structure is valid and normalized.
Where to put the user foreign key in this many to many relationship?
-
25-06-2022 - |
Frage
I have a many to many relationship with bookmarks and tags. Each tag can have many bookmarks, and each bookmark can have many tags.
Users
- Id
- Username
Tags
- Id
- UserId
- Title
Bookmarks
- Id
- UserId
- Title
- Link
TagsBookmarks (junction table)
- TagId
- BookmarkId
I have a reference to an UserId in Tags and Bookmarks table. Is this normalized? The reason I do this is because I sometimes need to load a list of tags that belong to a specific user without bookmarks, and vice versa.
Lösung
Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow