← Data Analytics from Scratch: SQL, Spreadsheets and Metrics
Lesson
Data types and how to tell them apart
Learner can classify a variable as quantitative vs categorical and, for numbers, as discrete vs continuous, and explain why the type drives which analysis is valid.
Quantitative vs categorical — and why it matters
Data type determines what analysis makes sense
Before you calculate anything, you need to understand what kind of thing you are calculating. Every column in a dataset has a type, and the type decides which operations and which charts are valid.
Quantitative data are numbers where arithmetic is meaningful. You can add, subtract, and average them. Examples: revenue in dollars, delivery time in minutes, temperature in degrees. Within quantitative data there are two sub-types. Discrete data are counted values — usually whole numbers with clear gaps between them: number of orders, number of customers, number of errors. Continuous data are measured values that can take any value within a range: height of a person, weight of a package, time elapsed.
Categorical data are labels and groups with no numerical meaning between them. City name (London, Paris, Tokyo), product category (electronics, clothing), order status (delivered, cancelled) — these are categories. You cannot average a city name. "(London + Paris) ÷ 2" is nonsense. You can, however, compute average revenue per city, because revenue is quantitative.
A classic trap: numeric codes that are actually categories. If a dataset encodes cities as 1 = London, 2 = Paris, 3 = Tokyo, those numbers are still categorical. Computing (1 + 2 + 3) ÷ 3 = 2 does not give you a "middle city" — it gives you a meaningless number. The type of a variable is defined by its meaning, not by how it looks. An analyst must ask: does arithmetic on these values produce a result that means something? If no, the variable is categorical.
Getting the type right matters from the very start: it determines which metric you compute (count vs mean vs percentage), which chart you draw, and which statistical test you can run.
Lesson notes
Data type determines what analysis makes sense
Before you calculate anything, you need to understand what kind of thing you are calculating. Every column in a dataset has a type, and the type decides which operations and which charts are valid.
Quantitative data are numbers where arithmetic is meaningful. You can add, subtract, and average them. Examples: revenue in dollars, delivery time in minutes, temperature in degrees. Within quantitative data there are two sub-types. Discrete data are counted values — usually whole numbers with clear gaps between them: number of orders, number of customers, number of errors. Continuous data are measured values that can take any value within a range: height of a person, weight of a package, time elapsed.
Categorical data are labels and groups with no numerical meaning between them. City name (London, Paris, Tokyo), product category (electronics, clothing), order status (delivered, cancelled) — these are categories. You cannot average a city name. "(London + Paris) ÷ 2" is nonsense. You can, however, compute average revenue per city, because revenue is quantitative.
A classic trap: numeric codes that are actually categories. If a dataset encodes cities as 1 = London, 2 = Paris, 3 = Tokyo, those numbers are still categorical. Computing (1 + 2 + 3) ÷ 3 = 2 does not give you a "middle city" — it gives you a meaningless number. The type of a variable is defined by its meaning, not by how it looks. An analyst must ask: does arithmetic on these values produce a result that means something? If no, the variable is categorical.
Getting the type right matters from the very start: it determines which metric you compute (count vs mean vs percentage), which chart you draw, and which statistical test you can run.