Number(P)
Definition :
Number(P) is generally used to store the integer values in a specific cloumn. Here P means precision. That means what size of interger you want to store you should define that size in the place of 'P'
Syntax :
Columnname number(size);Example:
Employee_id number(10),
Employee_salary number(5),
mobile_number number(10)
);
SQL> Insert into emp (mobile_number) values (0123456789);
Output : 1 row inserted.
SQL> Insert into emp (mobile_number) values (01234567891);
Output : ERROR:Value largerthan the specified precision value
SQL> Insert into emp (Employee_salary) values (999.9);
Output : 1 row inserted.
Explanation:
In the above example number(10) means we can store upto 10 digits of value.
For example mobile number = 0123456789.
We can not store morethan 10 digits.If we try to insert morethan 10 digits then database will throw an error. (ERROR:Value largerthan the specified precision value).