It is possible to make non-sensical queries. Instead it contains some hard coded patterns describing possibly pointless queries, or subqueries. Like all developers SQL programmers want their applications to run quickly. Because they specify requirements via a query rather than by an implementation, scope for clever algorithms is limited. Most of the efficiency savings are to be obtained by proper organisation of the database.
Vendors do provide query optimisers.
But there is still scope for avoiding inefficient queries. One general rule is to place the most restrictive query first, this reduces the work for subsequent SQL checks. Making such recommendations is strictly outside of the scope of a portability checker. Vendor extensions Use of all vendor extensions to SQL are flagged. Where possible a standard construct is suggested.