AI Glossary / AI and machine learning / Beginner

Data type

Definition

A data type describes what kind of value a column or field holds, such as whole number, decimal, text, date or true-false, and decides what you can do with it and how a model treats it.

What it means

Every column in a table has a type, even when nobody wrote it down. Order quantity is a whole number, price is a decimal, customer name is text, signup date is a date, and is_active is true or false.

The type matters because it decides which operations make sense. You can add prices, you can sort dates, but averaging postcodes or adding phone numbers is meaningless.

Types are also where many data bugs hide. Dates stored as text sort wrongly, numbers with currency symbols fail to add up, and IDs stored as numbers lose their leading zeros.

AI tools read types to choose preparation. Numbers may be scaled, text turned into tokens, dates split into parts, and categories encoded, each by a different method.

For a business, checking data types is a cheap first step before any analysis, and one of the most common explanations for a report that does not add up.

Dates and times deserve special care. A date can be a point in time, a month label or a duration, and time zones add another layer of trouble when systems disagree.

How it works

Inspect each column and confirm its type matches its meaning, not just its appearance.

Fix mismatches: convert text dates to real dates, strip currency symbols from numbers, and keep identifiers as text.

Decide how each type will be used: numbers as measures, categories as groups, dates as time, text as content for language tools.

Handle missing values by type, since a missing number and a missing label call for different treatments.

Document the types in a data dictionary so everyone reads the same column the same way.

When combining files, compare types column by column before joining. A join between text and number versions of the same ID silently matches nothing.

Three practical examples

  • A sales table where order dates are stored as text, so December sorts before February.
  • A customer file where ZIP codes lose their leading zeros after being treated as numbers.
  • A spreadsheet where prices carry currency symbols and cannot be summed until cleaned.

Think of it this way

Think of a kitchen with labeled jars. Sugar and salt look alike, but the label says what you can do with each. A wrong label spoils the recipe, however good the cooking.

The limit: labels can be wrong. A column called amount may hold text, and the only way to know is to look inside.

Worked example

the month that sorted wrongly

Suppose an analyst sorts sales by date and finds that 10 March appears before 2 April and after 2 February in a strange order. The dates are stored as text.

Sorting text is alphabetical, so 10/03 comes before 2/04. The analyst converts the column to a real date type and the order, and a monthly chart, fix themselves. The example is illustrative.

A second check reveals customer IDs stored as numbers have lost leading zeros, breaking joins to another table.

The lesson: two type errors explained two puzzling reports, and neither needed advanced skills to fix.

Illustrative case study

A fictional retailer's loyalty report shows a customer base 30 percent smaller than expected.

Investigation finds IDs stored as numbers in one system and text in another, so many customers failed to match. Aligning the types restores the true count.

The invented lesson: when numbers disagree between systems, check types and formats before suspecting the business.

The retailer adds an automatic type check to its nightly load, which flags any column whose type changes from one export to the next. The first alert arrives within a month, when a supplier feed switches dates to a new format.

Common misconceptions and mistakes

  • Data types are for programmers only. They affect every spreadsheet, report and dashboard.
  • A column that looks numeric is a number. IDs, postcodes and phone numbers are labels printed as digits.
  • Types fix themselves on import. Tools guess, and wrong guesses are common.

Business use

Before any analysis, check each column's type against its meaning, and fix mismatches at the source if possible.

Keep a data dictionary with each field's type and meaning, and update it when systems change.

Add type checks to any recurring report so a changed export format is caught on the day it happens instead of three months later.

Teach the team the two-minute check of sorting each column and scanning for oddities at the top and bottom. Wrong types usually show up as strange order or blank-looking values.

People also ask

What are the common data types?

Whole numbers, decimals, text, dates and times, and true-false values.

Why do IDs lose leading zeros?

Systems treat them as numbers; identifiers should be stored as text.

What is a data dictionary?

A document describing each field's meaning and type, so everyone reads the data the same way.

What is a schema?

A formal description of a table's columns and their types, used to catch bad data before it spreads.

Check your understanding

Why should ZIP codes and phone numbers be stored as text rather than numbers?

Answer: They are labels, not amounts; treating them as numbers drops leading zeros and invites meaningless arithmetic.

Related terms

  • Categorical data
  • Continuous feature
  • Data cleaning
  • Schema
  • data dictionary

Learn next

Be Productive Using AI shows how to use AI to spot and fix messy spreadsheet data faster: https://aiforbusinessandlife.com/academy/be-productive-using-ai. [C1]

More in AI and machine learning

  • Cross-fitting - Cross-fitting is a validation technique where predictions for every data point are made by a model that never saw that point in training, giving honest...
  • Data analysis - Data analysis is the process of inspecting, cleaning and summarizing data to answer a question or support a decision, ranging from simple totals and charts...
  • Data augmentation - Data augmentation is the practice of creating extra training examples by changing existing ones in ways that keep their meaning, such as flipping or...
  • Data-driven model - A data-driven model is a model whose relationships or parameters are learned substantially from observed data.
  • Data exploration - Data exploration is the process of examining a dataset to understand its structure, quality, patterns and limitations before drawing firm conclusions or...
  • Data leakage - Data leakage is when information from outside a model's legitimate training view, often the answer itself, slips into its inputs, making test results look...

Sources

[S14] KNIME, Data Science Glossary; [S24] scikit-learn documentation, Glossary of Common Terms and API Elements. Full URLs are in the source ledger. Verified 11 October 2026.

Previous: Data truncation Next: Data validation according to a list

  • Home
  • Daily AI Updates
  • Blog
  • AIFBL Academy
  • AI Glossary
  • Products and Tools
  • Store
  • Free CFO AI Prompt Pack
  • About Shihan Sheriff
  • Privacy Policy
  • Terms of Use
  • Refund Policy
  • Cookie Policy
  • Earnings Disclaimer