decimal datatype in MYSQL

by Nirmala 2009-02-02 09:54:30

Hi...
Decimal Datatype
Syntax:

decimal(M,D).
-> M denots the maximum number of degits.
-> D denotes number of digits to the right of decimal point.
-> M is larger than the D.
If you use decimal datatype,should specify NOT NULL in creating the table.
Create the table:
create table test(id decimal(3,2) NOT NULL,cost decimal(5,2) NOT NULL);

Insert values into the table:
insert into test values(1.10,500.00);

Tagged in:

1579
like
1
dislike
0
mail
flag

You must LOGIN to add comments