# Objectives
+ In this chapter, you will learn to:
  + List reasons for using prepared statements
  + Use the `mysql` command line client to `Prepare`, `Execute`, and `Deallocate` the prepared statements
  + Describe the execution plan cache
  + Use prepared statements by programming API
-------------------------------------------------------------
Usually, you prepare and execute statements from program code using Connectors. However, to aid in testing and debugging, you can define and execute prepared statements from within the mysql command-line client.

When the server prepares a statement, it creates a protocol for that statement. Typically, the client passes SQL statements along with values, and these are parsed by the server from the original text strings. The protocol for the prepared statement separates the values from the rest of the statement and provides a binary mechanism to transmit values. This is more efficient than converting to and from strings.

Prepared statements also help to prevent a form of attack known as SQL injection. A malicious user can insert SQL commands into an application that expects values. Prepared statements separate SQL commands from values and prevent the interpretation of values as SQL statements.
