i have seen that we can have composite keys where the primary key is made up from combined primary keys of two tables.
Like persons and Books
person_id a
If you are storing a relation between person and books that is one-to-one (for example, perhaps you are running a website where users can rate books they've read on a scale of 1-5), then a composite primary key on the votes
table of person_id
and book_id
makes just as much sense, if not more, as having a generated ID and a unique index on the combination of (person_id, book_id)
. The combination of the person and the book defines the vote record.