Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1069175
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T20:22:59+00:00 2026-05-16T20:22:59+00:00

Suppose I have a table Books with columns Book_ID (Primary Key), ISBN (Unique), and

  • 0

Suppose I have a table Books with columns Book_ID (Primary Key), ISBN (Unique), and several others such as Title/author/etc.

I have another table Sales, with primary key Sale_ID, a foreign key to link to Books, and other fields with info on Sales. Sales only exist for books with ISBNs. Is it better database design to have Book_ID or ISBN be the primary key. Note: I will be LEFT JOINing Sales to Books on whichever the foreign key is chosen.

UPDATE: Some Books have no ISBN’s because they’re not published with them. However, I don’t foresee (at least in the next several years) users being able to sell them, because I have no system for making sure that a given book w/o the ISBN isn’t repeated.

  • 1 1 Answer
  • 3 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T20:23:00+00:00Added an answer on May 16, 2026 at 8:23 pm

    In general, I think I would go for the surrogate primary key book_id as the foreign key.

    There are a few potential issues that I can identify if you were to use the non-primary key ISBN as a foreign key:

    • You might have a missing or unknown ISBN for a particular book. What would you do in case there is a sale of that book?
    • You might have an incorrect ISBN. To edit it, you would have to update all the tables that would be using it as a foreign key.
    • You might want to start selling books that don’t have an ISBN in the future. Why are you storing books without an ISBN in the first place?
    • An index on book_id should be much more compact than one on an ISBN field.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Suppose I have a table Item (Id int Primary Key, Number INT) having records
Suppose each Person has a collection of favorite Books. So I have a table
I have a table Books, where I store Book data (ISBN's, Titles, Authors, etc.).
Suppose I have a table with the following rows, ... <tr> <th title=Library of
Suppose I have an HTML table with the following rows, ... <tr> <th title=Library
I have a two table first is simple primary key based table and second
Suppose I have a table with four columns: ID, ParentID, Timestamp, Value. The ParentID
Suppose I have a table like that: create table reserved ( id int(4) primary
This a very basic database design/normalisation question. Suppose I have a Books table with
Suppose I have following table UserID (Identity) PK UserName - unique non null UserEmail

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.