The tables are client
, promo
, and coupons
client
can have multiple promo
and promo
will have several coupons.coupon_codes
and will have coupons.copon_status
.
Now I want to perform a delete on a client
but I want to check first that there are is no unused coupons.coupon_code
on a promo
based on the coupons.copon_status
which would be 0 for unused and 1 for used.
I don't know how to make mysql table here so i have to write my question.