1-- DECIMAL(p,s) p: number of digits (lkeft+right) s: number of digits (right)
2-- NUMERIC and DECIMAL are synonyms
3CREATE TABLE test.sql_decimal (
4 dec_col DECIMAL (4, 2) -- Max total 4 digits, including 2 after decimal
5);
6INSERT INTO test.sql_decimal (dec_col) VALUES (10.05); -- OK 4 digits
7INSERT INTO test.sql_decimal (dec_col) VALUES (21.0425); -- KO