samius polis
samius polis

Reputation: 379

Insert negative values into mysql database?

My question is very simple, is it recommended to insert negative values into database?

My field has type INT as integer and I can put numbers like (-20, -30, -33), but it is recommended?

I need more subtraction operations, is this better to do with mysql or php? In PHP case I can insert all values as positive.

Upvotes: 2

Views: 5692

Answers (1)

Eric Yang
Eric Yang

Reputation: 2750

There's nothing wrong with having negative numbers in the DB. In general if you have to subtract a lot of numbers I would do it in the db rather than the app

Upvotes: 2

Related Questions