ISBN - skytreader/Librarian GitHub Wiki
ISBN is a unique identifier for all books. Even two books with the same title and by the same author will have different ISBNs if it came from different publishers. Since it uniquely identifies books, it is the primary key used for the books
table of the database.
SQL Declaration
Taking from the books
table, the ISBN is declared as
CREATE TABLE IF NOT EXISTS books(
isbn VARCHAR(13) PRIMARY KEY,
title VARCHAR(255) NOT NULL
) ENGINE = MYISAM;
We do not need to require that the ISBN is strictly 13 characters. Some ISBN's (those issued before 2007) have 10 characters. We declared it as VARCHAR
since some ISBN's will contain non-numeric characters.