Ask the Expert

Adding reviews to a database of books and authors

This is a pure design question. I have a library database (MS Access). Books can be part of a series (1:m). Books can have parts (1:m). Books have authors (m:m). Parts have authors (1:m). Now I want to add reviews to the database. But a review can be about a series, a book, a part, an author or a partAuthor. At this moment, I have different Review tables for each case. This makes it difficult (impossible?) to show reviews as one list (sorted on date for example). How can I get all reviews in one table? Like a 1:m to the different tables. I have autonumbers in there...

    Requires Free Membership to View

There are many ways that this can be done, but the simplest way I can think of would be to create a reviewSubjects table. It would have an AutoNumber PK (Primary Key), and an FK (Foreign Key) for each type of review (like series, book, and author). This gets a little ugly if you have to join beyond this table to produce a comprehensive result set to address every type of review, but that is a design decision that you may not have to make.

For More Information

  • What do you think about this answer? E-mail the editors at editor@searchDatabase.com with your feedback.
  • The Best Database Design Web Links: tips, tutorials, scripts, and more.
  • Have an Oracle or SQL tip to offer your fellow DBAs and developers? The best tips submitted will receive a cool prize. Submit your tip today!
  • Ask your database design -- or help out your peers by answering them -- in our live discussion forums.
  • Ask the Experts yourself: Our SQL, database design, Oracle, SQL Server, DB2, metadata, object-oriented and data warehousing gurus are waiting to answer your toughest questions.

This was first published in February 2002

There are Comments. Add yours.

 
TIP: Want to include a code block in your comment? Use <pre> or <code> tags around the desired text. Ex: <code>insert code</code>

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
Sort by: OldestNewest

Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to: