mysql - Best way to design table with many category columns -


i have book table columns like

book-id title description author category1 category2 category3

100001 micro blah blah michael crichton scifi action mystery

but categories available 22 each book allowed 3 category column can have of categories

for searching set up, becomes extremely hard , there 6000 books far listed on it.

what best way categories in database design make searching easier? tried giving them index column caused table throw 1070 error. in advance gary

try architecture:

  • book_detail: hold book related information auto-increment id
  • category: hold categories list in auto-increment id
  • book_category: hold mapping of book -> categories, 1 many mapping, means 1 book can map different categories primary key like:

book_detail.id -> category.id


Comments

Popular posts from this blog

Command prompt result in label. Python 2.7 -

javascript - How do I use URL parameters to change link href on page? -

amazon web services - AWS Route53 Trying To Get Site To Resolve To www -