Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Naming website strings

Tags:

naming

There are 2 types of strings in any website:

  1. Shorter with no formatting (menu items, section titles, labels...).
  2. Longer with formatting (content).

If you have to store these 2 types of strings in 2 different database tables, how would you call these 2 tables?

like image 719
Emanuil Rusev Avatar asked Mar 01 '26 15:03

Emanuil Rusev


2 Answers

  1. Labels
  2. Content
like image 121
FallenAngel Avatar answered Mar 04 '26 17:03

FallenAngel


In SQL the shorter ones are generally called varchar and the longer ones text.

That's not to say that you'd never put HTML in a varchar, just that text fields are better suited for arbitrary-length strings.

like image 28
Skilldrick Avatar answered Mar 04 '26 16:03

Skilldrick