Glossary · Database
Stored Procedure
A precompiled set of SQL statements stored in the database that can be executed as a single unit.
A stored procedure is a prepared SQL code that is saved in the database and can be reused. It accepts parameters, executes a series of SQL statements, and can return results. Stored procedures offer several advantages: they reduce network traffic by executing multiple statements in a single call, improve security by controlling data access through parameterized interfaces, enable code reuse, and can improve performance through precompilation and execution plan caching. They are commonly used for complex business logic, data validation, batch processing, and administrative tasks. All major databases support stored procedures, though syntax varies between vendors.
In practice
How AI for Database applies it
Fig — every answer ships with the tables, rows and SQL behind it.
Related terms
See it on your own database
Connect read-only in minutes. Free models included.