AI engineering glossary · SQL databases
What is parameterised query?
Parameterised query (also called Bind variable): A query written with placeholders for values, which are sent to the database separately from the SQL text, so input is always treated as data and never as code. It blocks injection and allows plan reuse.
Parameterised query: an example
cursor.execute('SELECT * FROM users WHERE email = %s', (email,)) keeps user input out of the SQL string.
Related terms
- SQL injection
- Prepared statement
- Stored procedure
More SQL databases terms
- PARTITION BY
- Phantom read
- PostgreSQL
- Primary key
- Query optimizer
- RANK and DENSE_RANK
- Recursive CTE
- Referential integrity
Where you learn it
Parameterised query is part of the AI Engineering Program, which teaches it with notes, a hands-on lab and an exam. The first lesson is free.