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: 
you can only create ONE primary key. If you want the other fields to be unique, you have to create UNIQUE CONSTRAINT
Your design is significantly flawed, as described in the other question that you linked to.

Dep\_ID probably does not belong in salaries, it belongs (as a primary key) in departments and as a foreign key in employees. If it does belong in salaries (because your employees can be simultaneously paid from two departments, or can change departments and you maintain historical salary data) it shouldn't be part of the primary key.

The primary key in salaries should be either a single auto-incremented salary\_id column or, if your design is to store only a single, current salary entry per employee, the employee\_id.