Are race conditions possible in SQL?
According to the SQL standard a single SQL query sees a consistent state of the table(s) it operates on. So it must not see any changes while it's running. But not all DBMS products completely comply with that (notably those that allow dirty reads). For example Postgres or Oracle will not block the INSERT while the SELECT is running (or vice versa). But different DBMS do behave differently in that situation depending on their configuration. - a-horse-with-no-name