Identifying entities for a database?Watch
Find all books in a specific category within a specified date range
Find all books by specific authors
Write a comment on a book
List all details (including all comments and images, e.g., sample pages) of a book where the book description matches a specified pattern, e.g., the word “Machine Learning” appears in the book description
The application and its data access should be optimised for these use cases so that the number of separate queries required for a use case is minimised.
I am stuck with this.
At first, I thought that there would be two entities, Book(s), Author(s).
Book entity would have: category, data range, author name, comment, details, book description.
Author: would have name, and be a seperate entity of itself.
Then I thought it would be better to parse the book details into a seperate entity, bookDetails:
Looking at it, I think that categories and authors have a one to many relationship, a category can encompass a number of books, and an author can write many books.
Comments, details and book description could be better served in as an entity by themselves.
I guess, how do I normalise data from use cases as is the case here?