Welcome to the second part of our Understanding Data Types course. Today, we're going to deal with numerical data types.
Let's get started!
Remember your school days? You didn't learn all kinds of numbers at once. In kindergarten, you learned natural numbers (1
,2
,3
). Later, you were taught fractions (1/3
, 3/5
or 0.2
, 0.7
) and negative numbers (-3
, -4.5
). At some point, you may have learned real numbers (e.g., \pi, \sqrt{x}).
Why weren't you taught all the numbers at once? Because some of them are simple and some are more complex. Adding fractions, for instance, is more difficult than adding natural numbers. It's easier to add 1 + 2
than 3/2 + 4/5
.
The same applies to databases. They can make calculations faster if they know what kind of numbers they have to compute.