I had these structure in my DB :

```
Table coupon
coupon_id , code, max_used

Table coupon_history
coupon_history_id, coupon_id, used_date

```

Can I get coupon data where "coupon.max\_used" no more than total history at "coupon\_history"?
I get stuck here. I need to get a coupon\_code. Please help me.