How to link books of series together

database-designmany-to-many

enter image description here

I have to link all the books in series together but I'm not sure.

I have a SERIES_ID under which there is a name for a series, author, number of books and number book in the series.

I'm not sure how to have a list of all the other books in a series or at least previous and next book.

So if I had a copy of the 2nd book in a trilogy the first and third book would appear.

Any advice?

Best Answer

Your series table is compound. You need to split it up.

Series ( series_id, name )
Series_Book ( book_id, series_id, series_ordinal )

Now you can easily seek to the series_ordinal-1, series_oridnal+1 for the series. Storing the count() as number of books also seems redundant.

Genre and Theme are also pretty nebulous. That method of classification doesn't scale well, or work all that well with humans. Normally you want hierarchical tags, and cloud tags; otherwise, enter "is the Beatles pop or rock?"