Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums Other How to setup a database table? Re: How to setup a database table?

#141099
__
Participant

>Even if I set the primary key to both?

yes, order is important with compound keys.

_(I edited my post above to clarify.)_

You _could_ index each column separately (`PRIMARY` on one, `UNIQUE` on the other) if you wanted to, but if you’ll [almost] always be reading _both_, I’d recommend the compound PK.