I have a query about ISBN. Some books have one ISBN, SOME have two. Is it appropriate to use ISBN AS a primary key for a book table ( as I have seen it in one book).
What is ISBN basically. What can be the appropriate primary key for book & other products like laptops.

Recommended Answers

All 3 Replies

ISBN is a unique identifier for a publication.
You could use it as a primary key, but that would only work if you don't intend to ever have more than one copy of any specific edition of any specific title.
It will also not work if you consider different editions of the same title to be identical for the purpose of your application, as those would have different ISBN.

You can have 2 different ISBN per edition as you have seen. The original system which is still in widespread use to date uses a number made up of 10 characters (digits, and in some cases the letter X).
A new, complementary, system is being put into use which uses 13 characters. All books at this moment have an ISBN10. Some may also have an ISBN13.

Apart from that many publishers also use internal codes and numbers which they put on the back of books as well. These are not ISBN, but purely internal codes for the publisher, and aren't guaranteed unique anywhere.

The ISBN is made up of a number of sections, most notably a section indicating the publishing company.
That way each publisher has a block of numbers they can assign to publications.

if ISBN is not appropriate as a primary key? then what should be.
is ISBN only applicable to books. What about other products like laptops?
I have seen a database with strange 16 to 32 digit number as a primary key for products like laptops.

Make your own number system and print and use barcode stickers.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.