Question: I have this situation:

[MySQL - Newbie question: Which are the PK and the FK for these tables?](https://stackoverflow.com/questions/1590033/mysql-newbie-question-which-are-the-pk-and-the-fk-for-this-tables) (take a look at the table **Salaries**)

How do you create a table with multiple primary keys?

```
create table salaries
(
  dep_id smallint auto_increment primary key, 
  emp_id smallint auto_increment primary key, 
  bla varchar(20)
);

```

I receive an error if I try the code above. Any ideas?

Answer: 
The other answers technically address your literal question, but you have a serious design flaw in progress here.

After reading your other question, it looks like this is intended to be the middle table in a Many-Many join. If this is the case, both of those fields would be foreign keys in this table and primary keys in the tables they link to.

As foreign keys you don't need to do any special specification when creating them other than being sure to index them. Also, you don't want them to be unique in this table, they have to accommodate duplicate values in each so you can join multiple items on both sides of the M-M join. Nor do you want either of these fields to auto-increment in this table. They should do that in the referenced tables (employee/department)
```
create table salaries
( dep_id smallint auto_increment,
  an_id smallint auto_increment,
  bla varchar(20),
  PRIMARY_KEY (dep_id, an_id)
);

```

not sure if you can use auto-increment on both of them though