SQL injection is a code injection technique that exploits a security vulnerability occurring in the database layer of an application.
The vulnerability is present when user input is either incorrectly filtered for string literal escape characters embedded in SQL
statements or user input is not strongly typed and thereby unexpectedly executed.
It is an instance of a more general class of vulnerabilities that can occur whenever one programming or scripting language is embedded inside another.
SQL injection attacks are also known as SQL insertion attacks.
To protect against SQL injection, user input must not directly be embedded in SQL statements.
Instead, parameterized statements must be used (preferred), or user input must be carefully escaped or filtered.