Skip to main content

Do i need 2 tables to book entity? [Resolved]

I am developing a website to store books info such (title, book_no, author, edition, container...). I have two types of insert

  1. insert series of books (Eg: harry porter series: chapter 1, 2,3...)
  2. insert single book

I have created two table for this series and books, series table to store series info such (series_title, author, edition...) and books table to store books info such (book_title, book_no, container). To insert either series of books or single book I have two forms to submit, one is inserting series info 2nd is inserting book info for that particular series. This way makes my app easy like no need to enter series info multiple time when inserting each series of book, I can easily check books under particular series, I can easily search books.

Now I have a situation that, also I have to insert the books from excel sheet which is got 1000s book info. But the problem is it has included single book and series of books, so i cant differentiate either a single book or series of book. for this, if I merge my tables into only books table I can archive this but i have to lose some of the features that I told before. am I doing this wrong? please explain to me if there is an efficient way for this

Question Credit: Looper
Question Reference
Asked June 25, 2019
Posted Under: Programming
3 Answers

I think your separate table for series is a good solution. I assume you still put each book in the book table and link them to a series row?

The problem with any solution you come up with is that you cant force everyone else in the world to follow it.

If you got rid of the series table you might find the next import did have a separate series tab.

I would imagine that you could add some initial parsing to the excel spreadsheet to try and determine when a book was in a series.

Perhaps you could lookup the author on wikipedia and parse the webpage? I've noticed that they often have well formatted lists of series and books. It wouldn't be 100% accurate, so you would need some human checking after each upload.

credit: Ewan
Answered June 25, 2019

Yes you should make 2 tables for book entities. As you have different types of records to be inserted in the table. In one table you only have books which have series or multiple editions while other table has those books which have only single edition. It will become quite easy at the time of fetching the data.

credit: Ishan Shah
Answered June 25, 2019
Your Answer