thinQmaster Virtual testing partner Adaptive practice exams that find your weak spots and drill them. Every answer explained. From $69
Enroll

thinQmaster

Find your exam

Five questions free, before you decide.

Step 1 · choose a vendor

In one of our camps? Your practice exams come with the tuition — they are on your study page already.

Data & Analytics · Foundational

SQL Data Types

The categories of values a column can hold: numeric (INT, DECIMAL, FLOAT), character (CHAR, VARCHAR), date/time, Boolean, binary and semi-structured.

Definition

Choosing the right data type controls storage, precision, valid operations and sort behavior. CHAR is fixed-length while VARCHAR is variable-length. DECIMAL/NUMERIC stores exact values, which suits money, whereas FLOAT and REAL are approximate. Modern platforms add semi-structured types such as JSON or Snowflake's VARIANT.

Example

Price DECIMAL(10,2) stores up to 10 digits with 2 after the decimal point.

Exam tip

Use DECIMAL, not FLOAT, for currency, because floating-point rounding causes errors.

Related terms