Let's say there is a hospital that runs a simple database. In this database is a table called "patients" with 1,000,000 records--each record being a patient whose status is either "active" or "discharged".
Bob runs the following query that will take a few seconds or maybe minutes to run:
SELECT COUNT(*) FROM PATIENTS WHERE STATUS = "active"
At the moment Bob begins execution of the query, 100 patients are active.
However, while the query is running, Susie runs the following command on the table:
UPDATE PATIENTS SET STATUS = "discharged" WHERE PATIENT_ID = 583739789
This command discharges one of the active patients, changing the real "active" patient count to 99.
After Susie does this, Bob's query finishes. Will the result of his query be 100 or 99 active patients? How do the different databases handle this (Oracle, MySQL, SQLite, etc)?