The values of produce_prices must be < wholesaler_prices must be < retailer_prices.
Can I apply check constraints for these to happen?
The table is the following:
CREATE TABLE `crop_products_price` (
`ID` int(11) NOT NULL,
`office_type_id` int(11) NOT NULL,
`established_markets_id` int(11) NOT NULL,
`weekdays_id` int(11) NOT NULL,
`crop_products_category_id` int(11) NOT NULL,
`crop_products_id` int(11) NOT NULL,
`units_id` int(11) NOT NULL,
`producer_price1` float NOT NULL,
`producer_price2` float NOT NULL,
`producer_price3` float NOT NULL,
`wholesale_price1` float NOT NULL,
`wholesale_price2` float NOT NULL,
`wholesale_price3` float NOT NULL,
`retail_price1` float NOT NULL,
`retail_price2` float NOT NULL,
`retail_price3` float NOT NULL,
`date` date NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;`
- The values of producer_price1, producer_price2, producer_price3 must be less than the values of wholesale_price1, wholesale_price2, wholesale_price3
- and the values of wholesale_price1, wholesale_price2, wholesale_price3 must be less than the values of retail_price1, retail_price2, retail_price3.