AI engineering glossary · SQL databases

What is locking?

Locking (also called Lock): The mechanism by which a database prevents conflicting concurrent access by making transactions wait for a row, page or table to be released. Shared locks allow reading together, exclusive locks allow only one writer.

Level: advancedTopic: SQL databases

Locking: an example

SELECT ... FOR UPDATE locks the selected rows so no one else changes them until the transaction ends.

Related terms

More SQL databases terms

Where you learn it

Locking is part of the AI Engineering Program, which teaches it with notes, a hands-on lab and an exam. The first lesson is free.

Before you go

Take the cheat sheet with you

One free PDF: the key AI-engineering terms, formulas and Python idioms. No spam; unsubscribe any time.