Primary Key
AI said to update this record by id. Where does that id come from?
AI said to update this record by id. Where does that id come from?
Updating by id affects exactly one row; updating by email changes both rows.
Locate one row, not a batch: Updates and deletes by primary key affect exactly one row; locating by a repeatable field changes several rows.
Ordinary fields repeat: Identical names and emails happen all the time; a primary key's values cannot repeat and cannot be empty.
Tables link through it: When an orders table records which user an order belongs to, it stores the users table's primary key, not the name.
Update this user record by primary key, not by email or name. Before updating, tell me how many rows match; if more than one, stop and explain before continuing. After the change, query the record again to confirm.