Number columns hold various types of numbers, but that's not at all.
So they also allow you to perform calculations on these numbers.
And that's an important distinction from numbers you store as strings in a character column which can't
be added, multiplied, divided or perform any other mathematical operations.
Also, numbers stored as characters store differently than numbers stored as numbers.
So if you are doing math or the numeric order is important, you use number times and the number times
includes the integers.
Here, actually let me go to here.
So number types includes the integers, integers, which these are the whole numbers, both positive
and negative.
In this case, for example, 12 and here this is also number here, number here, number and so on.
And we also have the fixed point and floating numbers.
So floating numbers.
So this is the floating point number.
So these are the two formats of fractions, the full numbers here.
And we will look at each type separately.
So we will use integers firstly.
So the integer types are the most common number types you will find when exploring the SQL database.
So these are the whole numbers, both positive and negative, including zero.
And think of all the places integers appear in life, your street or apartment number, the serial number
on your refrigerator, the number on a raffle ticket and the SQL standard provides three integer types,
which is the Smallint or integer types here, which these are the Smallint Smallint integer and big
integer, big Bigint.
And the difference between these types is the maximum size of numbers they can hold.
And here I will write that so small integer small integer is a data type that storage size is two bytes,
two bytes and which the range is from minus -32.
Yeah.
32,768 to plus positive 32,767.
And we also have integer which holds four bytes of data, four bytes of data and which these are the
this number is pretty big, but it's, but it's nothing compared to big integer.
So it holds two.
It's from 214 and 7214748.
Uh, 36483648.
Here.
As you can see here we have we can hold.
To be
2,148,483,648
numbers from this number to this.
Just copy this to this.
Just seven.
4647.
And we also have big integer.
And guess what the storage size of this big integer is we can measure.
So I'm waiting here for you.
Yeah, it's eight bytes.
Eight bytes.
And here this is the
92233720368.
(368) 454-7758.
And zero eight from this number to this.
Thus seven instead of minus one.
Here.
So the big integer type will cover just about any requirement you will ever have with the number column,
although it eats up the most storage.
So it is it's use is a must.
If you are working with a number larger than 2.1 billion and but you also can easily make it your go
to default and never worry about not being able to fit a number in the column.
And on the other hand, if you are confident numbers will remain with within the integer limit.
Integer limit.
Uh, that type is a good choice because it doesn't consume as much space as big integer and a concern.
This is a concern when dealing with millions of data rows and when you know that values will remain
constrained at small integer makes sense.
So days of the months or years are good examples.
Then the INT type will use half the storage as integer.
So it's smart database design choice and the design decision.
If the column values will always fit within this range.
So if you try to insert a number into any of these columns that is outside its range, the database
will stop the operation and return an out of range error.