Directly to the point, at one time I have a table like this:

create table item(
    item_id varchar(50),
    constraint pk_item1 primary key (item_id)
}

However from my discussion one day, there is other option to include another id in int datatype as the primary key. This is to make the design as uniform as it can (every table has a primary key named id).

create table item(
    id int,
    item_id varchar(50),
    constraint pk_item1 primary key (id)
}

I don't seems agree with the second design as it add additional uneccessary cost and space. However I cannot find any silver bullet reason for the refusal. What is the worst impact of this design?

Please note I understand very well with the duplicated value in which can be handled with unique index. I also understand the header-detail problem, in which can also be handled with unique index.

  • 1
    This is a "holy war" question. There are exactly three correct answers to it, and I believe the subset of the Earth's population who understand what it is about is evenly divided into three camps supporting each of them. Check this for example: stackoverflow.com/questions/63090/… – mustaccio Feb 13 '14 at 1:47
  • @mustaccio: Ah well the terms is not easily searchable. Sorry if this is duplicated. – Fendy Feb 13 '14 at 1:54

Your Answer

 
discard

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Browse other questions tagged or ask your own question.