I am writing an application that helps book exchange between users. I am using PHP and MySQL, and I am pretty new to them both.
I have 5 tables, 3 data tables and 2 service tables:
user: with user attributes (user_id, name, birth... etc).
book: with book attributes (book_id, name, author, publisher... etc).
copy: represents actual copies of a books (copy_id, condition, comments... etc).
user_copy: describes which user holds which copy, composed out of userID and copyID.
copy_book: represents the connection of copy and book, composed out of copyID and bookID
My question is: what is the easiest and most efficient statement for getting the book attributes and copy attributes for each copy that a user holds?