There are two ways to write SQL: Static SQL, which gets the job done in most cases, and the second one is Dynamic SQL for the rest of the complex stuff.

Static SQL

  1. In a static SQL statement, most of the statement is hard-coded like table names and Column names. This part of the statement can not be changed at runtime.
  2. The only information that can be specified at runtime values in the WHERE clause of the SQL statement using host variables.
  3. The access plan for a static SQL is generated as soon as code is compiled.