Badges: 8
Report Thread starter 8 months ago
Consider a book store for this scenario:

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?

Quick Reply

Attached files
Write a reply...
new posts
to top
My Feed

See more of what you like on
The Student Room

You can personalise what you see on TSR. Tell us a little about yourself to get started.


How would you feel if uni students needed to be double vaccinated to start in Autumn?

I'd feel reassured about my own health (48)
I'd feel reassured my learning may be less disrupted by isolations/lockdowns (102)
I'd feel less anxious about being around large groups (39)
I don't mind if others are vaccinated or not (27)
I'm concerned it may disadvantage some students (17)
I think it's an unfair expectation (79)
Something else (tell us in the thread) (3)

Watched Threads

View All