需要准确存储的带小数的数据,要使用DECIMAL,特别是涉及金钱类的业务。而不要使用FLOAT或者DOUBLE。
因为DECIMAL是准确值,不会损失精度。
而FLOAT或者DOUBLE是近似值,会损失精度。

https://dev.mysql.com/doc/refman/8.2/en/fixed-point-types.html
https://dev.mysql.com/doc/refman/8.2/en/floating-point-types.html