SQL Review Guide

An online tool for DBA to generate the SQL review / DDL guideline.

Database Review Guide

Database

  • Error

    Prohibit deleting non-empty database

    Deletion is only allowed when there are no tables in the database, which can greatly avoid accidental deletion. Suggested error level: Error

System

  • Error

    Allowable list of Charset

    The character set determines which characters can be stored in the table. Using the wrong character set may result in certain characters in the application being unable to be stored and displayed correctly, such as CJK and Emoji. Suggested error level: Error

    Allow list: utf8mb4
  • Error

    Allowable list of Collation

    The collation determines the rules for character comparison and sorting. For example, when using a case-insensitive collation, "ABC" and "abc" will be treated as the same string in queries. Suggested error level: Error

    Allow list: utf8mb4_0900_ai_ci
  • Warning

    Restrict the length of comments

    Maximum comment length: 64
  • Warning

    Disallow to create procedures

    This rule prohibits the execution of procedures within the database. System procedures often perform critical operations that could impact the stability and security of the database environment. By disallowing their execution, it helps prevent unintended changes and potential vulnerabilities. Suggested error level: Warning

  • Warning

    Disallow to create events

    This rule prohibits the creation of events within the database. System events often perform automated tasks that could affect the database environment. By disallowing their creation, it helps maintain control over database operations and prevents potential disruptions. Suggested error level: Warning

  • Warning

    Disallow to create views

    This rule prohibits the creation of views within the database. Views provide a virtual representation of data that can simplify queries and enhance data security. By disallowing their creation, it helps maintain control over database schema and prevents potential security risks. Suggested error level: Warning

  • Warning

    Disallow to create functions

    This rule prohibits the creation of functions within the database. Functions provide reusable logic that can simplify queries and enhance data integrity. By disallowing their creation, it helps maintain control over database schema and prevents potential security risks. Suggested error level: Warning

Column

  • Warning

    Enforce the inclusion of specific columns in a table

    Some common columns are helpful for better application maintenance. For example, adding a business-independent "ID" column as the primary key avoids primary key conflicts caused by business changes (such as business mergers), and in some scenarios can also bring better data insertion performance. Suggested error level: Warning

    Required column names: id, created_ts, updated_ts, creator_id, updater_id