title: Allow some combination in sql
body: <p>I am working on one major issue where I have to add some constraint or need a way by which only this combination is allowed.</p>
  <p>Table User (Strind id, String status)
  <a href="https://i.stack.imgur.com/F2jxX.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/F2jxX.png" alt="User Table
  primary key Id String   Status Integer
  1   id1 1   Allowed
  2   id1 0   Allowed
  3   id1 0   Allowed
  4   id1 1   not Allowed as row 1 already exist" /></a></p>
  <p>only single id is allowed with value status 1. How can i write the constraint or how to solve this issue.
  <strong>mysql database</strong>
  Thanks,
  Hasnain</p>