Composite key

From Oracle FAQ
Jump to: navigation, search

A composite key is a key (primary or alternate) that consists of more than one column. Oracle will create a composite key index on the table to implement and enforce the composite key. Composite keys are also known as concatenated or aggregate keys.


For example, the LINE_ITEMS table may have composite keys on {orderID, itemNumber} and {orderID, productId}:

CREATE TABLE line_items (
  orderID    NUMBER,
  itemNumber NUMBER,
  productId  NUMBER,
  quantity   NUMBER,
  PRIMARY KEY (orderID, itemNumber),
  UNIQUE (orderID, productId));

Also see[edit]

Glossary of Terms
A B C D E F G H I J K L M N O P Q R S T U V W X Y Z #