How can you prevent SQL Injection attacks?
If this question looks familiar, it is. Interviewers will often ask different versions of the same question throughout an interview. The reason for this is to calibrate your answers to questions and make sure you are consistent. The best way to ensure that your answers to questions are the same is to answer them honestly and accurately. That way, you do not need to recall your previous answer to a similar question.
"There are several ways you can prevent an SQL injection attack. One way is closely defining the parameters for queries. This identifies nonstandard queries, allowing systems administrators to block them. A similar one uses prepared statements for queries and defines the SQL code they use. Another way to prevent SQL injection attacks is using stored procedures, in which a database administrator calls a procedure when they need it. The final methodology I prefer is known as lists input validation. This blocks any input which has not been stored on what is known as a white input list."
