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

  • Home
  • SEARCH
  • 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 9233921
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T06:40:02+00:00 2026-06-18T06:40:02+00:00

If we had a table like this: Books (pretend ISBN doesn’t exist) Author Title

  • 0

If we had a table like this:

Books (pretend “ISBN” doesn’t exist)

  • Author
  • Title
  • Edition
  • Year of publication
  • Price

One could argue that {Author,Title,Edition} could be a candidate/primary key.

What determines whether the candidate/primary key should be {Author,Title,Edition} or whether an ID column should be used, with {Author,Title,Edition} a unique index/key constraint?

So is

  • Author (PK)
  • Title (PK)
  • Edition (PK)
  • Year of publication
  • Price

better, or:

  • ID (PK)
  • Author
  • Title
  • Edition
  • Year of publication
  • Price

where {Author,Title,Edition} is an additional unique index/constraint?

  • 1 1 Answer
  • 0 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-06-18T06:40:04+00:00Added an answer on June 18, 2026 at 6:40 am

    Say that {Author, Title, Edition} uniquely identifies a book, then the following holds:

    1. It is a superkey — uniquely identifies a tuple (row).

    2. It is irreducible — removing any of the columns does not make it a key any more.

    3. It is a candidate key — an irreducible superkey is a candidate key.

    Now let’s consider the ID (integer)

    I can reason that the Book table key will show up in few other tables as a foreign key and also in few indexes. So, it will take quite a bit of space — say three columns x 40 characters (or whatever…) — in each of these tables plus in matching indexes.

    In order to make these “other” tables and indexes smaller, I can add a unique-integer-column to the Book table to be used as a key which will be referenced as a foreign key. Say something like:

    alter table Book add BookID integer not null identity;
    

    With BookID being (must be) unique too, the Book table now has two candidate keys.

    Now I can select the BookID as a primary key.

    alter table Book add constraint pk_Book primary key (BookID);
    

    However, the {Author,Title,Edition} must stay a key (unique) in order to prevent something like this:

    BookID  Author      Title           Edition
    -----------------------------------------------
      1      C.J.Date  Database Design     1
      2      C.J.Date  Database Design     1
    

    To sum it up, adding the BookID — and choosing it as the primary — did not stop {Author, Title, Edition} being a (candidate) key. It still must have its own unique constraint and usually the matching index.

    Also note that from the design point, this decision was done on the “physical level”. In general, on the logical level of design, this ID does not exists — it got introduced during the consideration of column sizes and indexes. So, the physical schema was derived from the logical one. Depending on the DB size, RDBMS and hardware used, none of that size-reasoning may have measurable effect — so using {Author, Title, Edition} as a PK may be perfectly good design — until proven differently.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I had a table like this id | name ------------------ 1 | SAM1 2
I had table like this: post: +----------------+-----------+ | article_id | tags | +----------------+-----------+ |
If I had a table like this: jobId, jobName, Priority Whereby Priority can be
I had created html table dynamically like this. Now I want to sort the
I have a MySQL table laid out like this: ID | Artist | Title
If I had a SQL Server table that looks something like this with some
If I had a CarsDataStore representing a table something like: Cars -------------- Ford |
SCENARIO: Imagine a TABLE like this: Auto_INC, UserID_FK, CaseID_FK, Date idX userX caseX and
Suppose you had this table: CREATE TABLE Records ( RecordId int IDENTITY(1,1) NOT NULL,
Say I have a table like this in my MsSql server 2005 server Apples

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.