SQL used to be nothing more than a data access method, a way to get rows from the database into an application program, but Oracle's extensions have transformed SQL into a procedural language.
SQL as a declarative language has many ways to create and execute any query, with identical results but with a huge variation in performance.
There are several areas of SQL programming best practices:
- Security: The application developer wants to avoid SQL injections
- Performance: Using low-impact techniques like analytic functions, rewriting subqueries whenever possible.
- Standards: Writing standard SQL is a challenge.