Search this blog

Tuesday, June 29, 2010

Composite Key / Concatenated Key / Aggregate Key:

Composite Key is a primary key, combination of more than one column to maintain unique record. It is also known as Concatenated Key or Aggregate Key

For example:

CREATE TABLE InvoiceDetails (
      InvoiceNo numeric(18,0),
      itemNumber numeric(18,0),
      productId  int,
      quantity   numeric(18,2),
      PRIMARY KEY (InvoiceNo, itemNumber))

InvoiceDetails table may have a composite key on InvoiceNo & itemNumber

1 comment:

  1. To learn .net, C#, Java, J2EE, Silverlight, Visual Basic, Asp .net with advanced concepts, you can visit http://advanceddotnettutorial.blogspot.com

    ReplyDelete