Lets say that I have a table where I want to record usernames. At minimum the table should have two columns : UserID and Name. Typically I see people put a primary key on UserID turn on auto increment and call it day.
However that seems wrong to me, shouldn't the key be a composite key between both columns? As we don't want the username to ever be repeated. We want to also keep UserID so that we don't break existing references to a particular user if their name changes.
What I'm getting at is it seems like many people default to an ID column with a PK on it for every table they make without making sure that key enforces uniqueness on other columns as well.
With that being said, am I correct in stating that a table should always have an ID column for referencing, but it is equally important to use composite primary keys?