Example 3: Reading from the database, performing additional analysis, and adding results back to the database