I have table that doesn’t need a specific field to be the primary key. I could add a auto-increment ID field, but it won’t be used at all within database queries…
Can I make a UNIQUE KEY to be primary too?
the UNIQUE KEY consists of two fields paired together:
a VARCHAR(64) NOT NULL,
b VARCHAR(64) NOT NULL,
UNIQUE KEY uk_ab(a,b)
Sure (no need for
UNIQUE KEY):Have a look at the documentation:
and