Data Types and Choosing the Right One

Data Types and Choosing the Right One

Every column in a database has a type that tells it what kind of value to expect — text, a whole number, a decimal, a date and so on. Choosing well keeps data accurate, compact and fast to query.

Poor choices cause subtle bugs, wasted storage and awkward calculations, so this is an area we get right early.

Why Types Matter

Storing a price as text instead of a number means you cannot easily add it up and risk values like '12.00.50' slipping in. The right type lets the database validate and work with data correctly.

A Few Common Pitfalls

  • Money stored as floating point, causing rounding errors — use a decimal type instead.
  • Phone numbers stored as numbers, dropping leading zeros — use text.
  • Dates stored as text, making sorting and ranges unreliable.
DataSensible type
MoneyDecimal / numeric
Phone numberText / varchar
Order dateDate / timestamp
On/off flagBoolean

If you need a hand with any of this, your Progressive Robot delivery team is ready to help. Raise a ticket from the Support area of your client portal or speak to your account manager and we will guide you through the next steps.

Did you find this article useful?