# Composite Primary Key

__*Composite Index*__

+ A composite primary key requires two or more columns to uniquely identify a row
+ Individual columns that make up a composite primary key do not need to be unique
+ `infromation_schema.tidb_indexes` 
  + `COLUMN_NAME` 
  + `SEQ_IN_INDEX` 

```12
CREATE TABLE `stars` (
  `name` char(20) NOT NULL DEFAULT '',
  `mass` float NOT NULL DEFAULT 0.0 COMMENT '10**24 kg',
  ...
  `distance_from_earth` float COMMENT 'light year',
  `discover_date` datetime NOT NULL,
  ~!@PRIMARY KEY (`name`, `discover_date`)@!~
);
```

------------------------------------------------------------

The two columns name and discover_date together form a composite primary key.
