DEV Community

Cover image for TLDR: Database Naming
An Pham
An Pham

Posted on

TLDR: Database Naming

Credit: Photo by Tobias Fischer on Unsplash

  • Table names should be plural (ex: users, customers,...)
  • Use underscore_names (ex: user_id, user_role,...)
  • Don't name primary key column id
  • Don't make column names unclear (ex: u_role,...)
  • Name foreign key columns the same as the columns they refer to

Top comments (0)