It is perfectly acceptable to update the database using a where
condition that doesn't reference the primary key.
You may want to learn about indexes and constraints, though. You query could end up updating more than one row, if multiple rows have the same name. If you want to ensure that they are unique, then you can create a unique constraint on the column.
A primary key always creates an index on that column. This index makes access fast. If there is no index on name
, then the update will need to scan the entire table to look at all names. You can make this faster by building an index on the field.