liveBook · Manning

Snake case

As explained in Grokking Relational Database Design

A naming style that separates words with underscores, typically using lowercase letters.

Snake case names separate words with underscores, usually in lowercase: first_name. It gives database attributes a consistent, readable form and helps prevent typos and query-maintenance errors. section 4.2

Use snake case as part of a deliberate naming policy:

  • Choose one convention for attribute names and apply it consistently. section 4.2
  • Write multiword attributes with underscores, such as first_name. section 4.2
  • Check that names stay within the database system’s length limit; MariaDB allows up to 64 characters. section 4.2
  • Avoid reserved SQL keywords as entity or attribute names because they can cause syntax and maintenance problems. section 4.2

How Grokking Relational Database Design covers it

How deep it goes
Defines the format, compares alternatives, and adds length and reserved-keyword checks without detailing implementation internals.
Examples
Uses first_name as the representative attribute name and discusses column-length and reserved-keyword checks.
What you can do after
Apply it by naming database attributes consistently and checking names before writing or maintaining SQL queries.
How it connects
Contrasts snake case with camel case, Pascal case, uppercase, Hungarian notation, semantic naming, entities, and attributes.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Grokking Relational Database Design. The section links point to the parts of the book it draws on.