1
00:00:00,440 --> 00:00:05,680
Number columns hold various types of numbers, but that's not at all.

2
00:00:05,690 --> 00:00:09,740
So they also allow you to perform calculations on these numbers.

3
00:00:09,740 --> 00:00:15,560
And that's an important distinction from numbers you store as strings in a character column which can't

4
00:00:15,560 --> 00:00:20,990
be added, multiplied, divided or perform any other mathematical operations.

5
00:00:21,140 --> 00:00:26,270
Also, numbers stored as characters store differently than numbers stored as numbers.

6
00:00:26,270 --> 00:00:33,260
So if you are doing math or the numeric order is important, you use number times and the number times

7
00:00:33,260 --> 00:00:35,630
includes the integers.

8
00:00:36,080 --> 00:00:37,850
Here, actually let me go to here.

9
00:00:37,850 --> 00:00:46,460
So number types includes the integers, integers, which these are the whole numbers, both positive

10
00:00:46,460 --> 00:00:47,510
and negative.

11
00:00:47,510 --> 00:00:55,190
In this case, for example, 12 and here this is also number here, number here, number and so on.

12
00:00:55,190 --> 00:00:59,630
And we also have the fixed point and floating numbers.

13
00:00:59,630 --> 00:01:02,640
So floating numbers.

14
00:01:02,850 --> 00:01:04,980
So this is the floating point number.

15
00:01:04,980 --> 00:01:09,930
So these are the two formats of fractions, the full numbers here.

16
00:01:10,350 --> 00:01:13,050
And we will look at each type separately.

17
00:01:13,050 --> 00:01:14,710
So we will use integers firstly.

18
00:01:14,730 --> 00:01:21,060
So the integer types are the most common number types you will find when exploring the SQL database.

19
00:01:21,060 --> 00:01:25,380
So these are the whole numbers, both positive and negative, including zero.

20
00:01:25,380 --> 00:01:31,710
And think of all the places integers appear in life, your street or apartment number, the serial number

21
00:01:31,710 --> 00:01:38,760
on your refrigerator, the number on a raffle ticket and the SQL standard provides three integer types,

22
00:01:39,630 --> 00:01:50,100
which is the Smallint or integer types here, which these are the Smallint Smallint integer and big

23
00:01:50,100 --> 00:01:51,600
integer, big Bigint.

24
00:01:51,600 --> 00:01:58,350
And the difference between these types is the maximum size of numbers they can hold.

25
00:01:58,350 --> 00:02:08,160
And here I will write that so small integer small integer is a data type that storage size is two bytes,

26
00:02:08,190 --> 00:02:15,150
two bytes and which the range is from minus -32.

27
00:02:15,510 --> 00:02:15,890
Yeah.

28
00:02:15,930 --> 00:02:25,470
32,768 to plus positive 32,767.

29
00:02:25,470 --> 00:02:33,840
And we also have integer which holds four bytes of data, four bytes of data and which these are the

30
00:02:34,830 --> 00:02:41,640
this number is pretty big, but it's, but it's nothing compared to big integer.

31
00:02:41,640 --> 00:02:43,470
So it holds two.

32
00:02:43,500 --> 00:02:52,800
It's from 214 and 7214748.

33
00:02:53,990 --> 00:02:57,850
Uh, 36483648.

34
00:02:59,450 --> 00:03:00,010
Here.

35
00:03:00,020 --> 00:03:02,630
As you can see here we have we can hold.

36
00:03:04,500 --> 00:03:05,640
To be

37
00:03:05,670 --> 00:03:12,120
2,148,483,648

38
00:03:12,150 --> 00:03:17,700
numbers from this number to this.

39
00:03:17,970 --> 00:03:20,610
Just copy this to this.

40
00:03:21,720 --> 00:03:22,410
Just seven.

41
00:03:23,190 --> 00:03:25,320
4647.

42
00:03:25,320 --> 00:03:28,110
And we also have big integer.

43
00:03:28,110 --> 00:03:33,640
And guess what the storage size of this big integer is we can measure.

44
00:03:33,960 --> 00:03:35,250
So I'm waiting here for you.

45
00:03:35,400 --> 00:03:37,230
Yeah, it's eight bytes.

46
00:03:37,590 --> 00:03:38,910
Eight bytes.

47
00:03:38,910 --> 00:03:40,310
And here this is the

48
00:03:40,320 --> 00:03:48,900
92233720368.

49
00:03:50,740 --> 00:03:56,980
(368) 454-7758.

50
00:03:57,790 --> 00:04:03,040
And zero eight from this number to this.

51
00:04:04,620 --> 00:04:07,110
Thus seven instead of minus one.

52
00:04:08,050 --> 00:04:08,320
Here.

53
00:04:09,650 --> 00:04:18,890
So the big integer type will cover just about any requirement you will ever have with the number column,

54
00:04:18,930 --> 00:04:21,410
although it eats up the most storage.

55
00:04:21,410 --> 00:04:24,740
So it is it's use is a must.

56
00:04:24,740 --> 00:04:32,540
If you are working with a number larger than 2.1 billion and but you also can easily make it your go

57
00:04:32,540 --> 00:04:36,590
to default and never worry about not being able to fit a number in the column.

58
00:04:36,590 --> 00:04:42,170
And on the other hand, if you are confident numbers will remain with within the integer limit.

59
00:04:42,200 --> 00:04:43,490
Integer limit.

60
00:04:44,340 --> 00:04:50,700
Uh, that type is a good choice because it doesn't consume as much space as big integer and a concern.

61
00:04:51,030 --> 00:04:57,720
This is a concern when dealing with millions of data rows and when you know that values will remain

62
00:04:57,720 --> 00:05:01,700
constrained at small integer makes sense.

63
00:05:01,710 --> 00:05:05,130
So days of the months or years are good examples.

64
00:05:05,130 --> 00:05:10,230
Then the INT type will use half the storage as integer.

65
00:05:10,230 --> 00:05:15,810
So it's smart database design choice and the design decision.

66
00:05:15,810 --> 00:05:21,300
If the column values will always fit within this range.

67
00:05:21,300 --> 00:05:28,500
So if you try to insert a number into any of these columns that is outside its range, the database

68
00:05:28,500 --> 00:05:33,720
will stop the operation and return an out of range error.
