In my application there are N number of Users. Each user can have N number of Categories. Each category can have N number of Books.
I have created following Entities BookMetadata, Users, Categories
BookMetadata entity is a unique collection of books data from different users.
How do I go about creating relationship between these entities.
Relationship between - Users & Categories.(one to many) or users & books (one to many, one user can have one or more than one book).
Relationship between - Categories & Books.(one to many).

Is my understanding about implementing these relationships correct, I'm relatively new in creating relationships in CoreData. If no or a better solution, please let me know how to go about it.
EDIT:
Consider this scenario,
User 1 -> Category 1 -> Book1,Book2.
-> Category 2 -> Book3, Book4.
User 2 -> Category 1 -> Book1,Book2,Book3.
-> Category 3 -> Book4
Here In the above scenario. The same Book (Book 3) has different category for the different user. How to handle this scenario?
EDIT 2:
I'm attaching a sample sqlite DB file @dropbox https://www.dropbox.com/s/nlmdojkk64bkf1b/test.sqlite.
