A variable is a value that subjects to vary. A variable is a characteristic that can assign different values. Age, salary, occupation, name, income tax etc. are few examples of variables. These can have values that are varying according to situation and from person to person.
Variables can either be discrete or continuous.
Discrete variables are the variables which cannot take any value. Discrete variables usually include counting numbers and finite number of values. They can include categories such as sex: male or female, eye color: black, brown, blue, green, grey or hazel. These variables can have finite number of categories. Discrete variables are not flexible enough to take any kind of value. On the other hand, continuous variable can assign any value.

Few examples of discrete variables are listed below:
  • In a shopping center, if the number of cars parked in parking lot are recorded every hour, then that will be a discrete variable. This is because, it can only be a whole number.
  • Record of skin colors of a group of people is a discrete variable, as it can have one of the categories: black, brown and white.
  • Marital status is a discrete variable. It can have only limited values like: married, unmarried, divorcee and widowed.
  • Population census records number of members in a family.
  • Grades assigned in an exam which can have only selected values such as: A, B, C, D etc.
  • Logical operator is also a discrete variable. It can have only true or false as its answer.
Quantitative variable are those which define only quantity or numeric data in themselves. Quantitative variable can be discrete or continuous. It can be categorized in the following three types:
  • Interval: A quantitative variable can be in interval form. For example, if marks of students are recorded, marks of few students will fall into interval 10 to 20, few marks will fall into interval 20 to 30 and so on.
  • Ordinal: An ordinal variable consists of set of values which are assigned to particular ordinal scale. For example, performance of employees of a firm can be categorized as poor, good, very good, excellent, outstanding and numbers 1, 2, 3, 4, 5 are assigned to them.
  • Ratio: This is a type of quantitative data which is in the form of ratio. This is a kind of comparison of all the values with a particular value. For example, molecular weights of various elements. If we take molecular weight of one selected element (say A), then take the ratio of other elements with it, like: molecular weight of B is twice as much as molecular weight of A and molecular weight of C is 1.5 times of molecular weight of A.
  • Nominal: Nominal measurement is the easiest type of the measurement of data. In this case, we just have to identify the category. Nominal data is also known as qualitative data, categorical data or attribute. It reflects the qualitative differences.
Qualitative variables are those which define quality or characteristic. Qualitative variables are defined on a nominal scale which means that values assigned in qualitative variables have no ordering. For example, Records of Age, gender, eye color, cloth size, name, favorite food item, religion etc are qualitative variables. Qualitative data defines attribute.
Qualitative data is also called categorical data.
Continuous variable can define any value. It can measure infinite and uncountable data. Continuous variable can be rational, irrational, floating point etc. Height and weight of people are continuous variables because both of them can take any value. Therefore, continuous data does not have restrictions.

On the other hand, discrete variable cannot define any value. It can only take a finite number of data. It cannot assign a rational number or a number with decimal point. The outcomes of a coin can either be head or tail. So, this is a discrete variable. The shoe size of a group of people is a discrete variable, because shoe size can be few selected numbers. It cannot take any value. Therefore, discrete data has restrictions of having only finite values.