Patent attributes
A computer-implemented method for automatically reviewing structured query language (SQL) statements comprises the steps of receiving SQL code from a user seeking to access a database, parsing the SQL code to retrieve SQL keywords, mathematical operators, and logical operators, applying a complexity score calculation algorithm to the parsed code, calculating a complexity score, and executing the SQL code on a computing system which stores the database if the complexity score is less than or equal to a threshold. On the other hand, if the complexity score is greater than the threshold, the SQL code may be flagged to be rewritten.