The goal is this: if there is an entry with such an id , then we increment the value in the count column of this row, and if not, we create a new entry (the count column is set to DEFAULT 0 ). Database - MySQL.
Of course, you can do several checks and implement such logic through the conditions in the programming language itself, but is it possible to do all this with a single SQL query (so that it works quickly), or at least make it somehow more elegant?