What is a phantom read and which isolation level prevents it?

SQL Fundamentals Hard

SQL Fundamentals — Hard

What is a phantom read and which isolation level prevents it?

Key points

  • SERIALIZABLE prevents phantom reads by locking the entire range of rows that a query accesses.
  • REPEATABLE READ prevents non-repeatable reads, not phantom reads.
  • READ COMMITTED prevents dirty reads, not phantom reads.
  • READ UNCOMMITTED allows uncommitted changes to be visible, not prevent phantom reads.

Ready to go further?

Related questions