How do you distinguish a missing field in PATCH from an explicit null?

A client changes the city in their profile through a PATCH request. The database column city allows NULL. Under the API contract, the client can omit the city field, explicitly send null, or provide a new string. What should the SQL do in each case? Why might SET city = COALESCE(:city, city) violate the API contract? Suggest an update strategy that preserves the distinction between these cases. How would you test that the query doesn't erase existing data or changes made by concurrent requests?

ExplainNULLSeniorBackendData EngineerQA