# Stored Procedures

> What are stored procedures, and what are the pros and cons of putting business logic in them instead of in your application code?

Canonical: https://www.internhack.in/learn/interview/database-design/db-stored-procedures-pros-cons
Last updated: 2026-11-28

Difficulty: Intermediate

## Question

What are stored procedures, and what are the pros and cons of putting business logic in them instead of in your application code?

*The full answer is for InternHack members. Open the page link above to read it.*

## Concepts covered

Stored Procedures, PL/pgSQL, Network Round Trips, SECURITY DEFINER, Vendor Lock-in

Previous: [Composite Keys](https://www.internhack.in/learn/interview/database-design/db-composite-primary-key) · Next: [Denormalization](https://www.internhack.in/learn/interview/database-design/db-denormalization-use-case) · [All of Database Design](https://www.internhack.in/learn/interview/database-design)

## More Database Design questions

- [Views vs. Materialized Views](https://www.internhack.in/learn/interview/database-design/db-view-vs-materialized-view)
- [Concurrency Control](https://www.internhack.in/learn/interview/database-design/db-optimistic-vs-pessimistic-locking)
- [B-Tree vs Hash Index](https://www.internhack.in/learn/interview/database-design/db-btree-vs-hash-indexing)
- [Deadlock Prevention](https://www.internhack.in/learn/interview/database-design/db-deadlock-prevention)
- [Surrogate vs. Natural Keys](https://www.internhack.in/learn/interview/database-design/db-surrogate-vs-natural-key)
- [Columnar Storage](https://www.internhack.in/learn/interview/database-design/db-columnar-storage-olap)

## Related

- [Learn](https://www.internhack.in/learn)
- [Interview Prep](https://www.internhack.in/learn/interview)
- [Database Design](https://www.internhack.in/learn/interview/database-design)
