Skip to content

Latest commit

 

History

History
66 lines (51 loc) · 1.71 KB

File metadata and controls

66 lines (51 loc) · 1.71 KB

SQL Style Guide

Schema Naming

  • Schema names should be uppercase with underscores between words.

Table and Column Naming

Created, Updated Data

  • Recommendation to include CREATED_DATE on most tables
  • Recommendation to include UPDATED_DATE on tables that are changed

Foreign Key Naming

  • Foreign key names should be uppercase.
  • Double underscores between table names.
  • Maintain single underscores from original table names.
  • Start with FK__.
  • Example:
FK__REFERENCING_TABLE__REFERENCED_TABLE

Index Naming

  • Indexes names should be uppercase.
  • Double underscores before table name.
  • Maintain single underscores from original table name and column name.
  • Start with IDX__.
  • Example:
IDX__TABLE_NAME__COLUMN_NAME

Uniqueness Naming

  • Uniqueness names should be uppercase.
  • Double underscores before table name.
  • Maintain single underscores from original table name and column name.
  • Start with UNQ__.
  • Example:
UNQ__TABLE_NAME__COLUMN_NAME