Take the case of two tables: tbl_product and tbl_transaction. tbl_product lists product details including names and ids while
tbl_product
tbl_transaction
Edit:
If you want to enforce a limit on each product I would separate it into two queries.
First get a list of 10 products and then run another query for each of those returning the last five transactions.