id_discount count_orders percent_discount
1 5 1,5
2 10 2,5id_client Name Surname
1 Ivan Petrov
2 Vasya Vasevid order_sumselect
Discount.percent_discount
from
Discount
where
(select count(Orders.id_client) where id_client = ...) BETWEEN Discount.count_orders_min AND Discount.count_orders_max