What is the main advantage of a prepared statement?
- A It runs faster on the first execution
- B It separates SQL structure from data, preventing SQL injection
- C It automatically creates indexes
- D It compresses the result set
Answer
It separates SQL structure from data, preventing SQL injection
Because values are sent separately from the query text, user input can never be parsed as SQL. Repeated execution of the same statement is also more efficient.





