java - MySQL Database schema design and relationships -


i'm designing project, logged users can add rating of books read, , add status book want read/read/will read. created tables: book, user, rating, status , i'm not sure how connect of these informations in 1 table (and if it's possible).

right now, have user_books table store foreign keys status_id, rating_id, book_id , user_id, i'm not sure if right way this.

relationships want create in springboot application:

  • user-book manytomany,
  • book-rating manytoone,
  • book-status manytoone.

enter image description here

looks want create many-to-many relationship. logically many-to-many relationships exists, when comes physical model, create mapping table, did -> user_books table. based on id mapping table, can these 1) number of users read "that" book. 2) highest ratings on book. 3) ratings based on book on user age group (if user table has age)


Comments

Popular posts from this blog

python Tkinter Capturing keyboard events save as one single string -

android - InAppBilling registering BroadcastReceiver in AndroidManifest -

javascript - Z-index in d3.js -