'How can I limit the max value of an SQL field?

I am trying to force the value of the field PRICE to be under 500 if is it paid with cash (PAYMENT = "CASH"), to make impossible to insert anything over that.

The table (SALES) is something like this:

ID (PK) [INT] | DATE [VARCHAR] | SHOP [VARCHAR] | PRICE [FLOAT] | PAYMENT [VARCHAR]

I am almost new with SQL and I have read that there are ways to do this, but I cannot find anything about it. How can I add this kind of "rules" to my table?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source