title: Using foreign keys with multiple primary key combinations
body: <p>I have a company table with the following fields:</p>
  
  <pre><code>CompanyID
  EmailDomain1
  EmailDomain2
  EmailDomain3
  ...
  </code></pre>
  
  <p>I have another table t with the following fields:</p>
  
  <pre><code>CompanyID
  EmailDomain
  EmailDomainstat
  </code></pre>
  
  <p>The following are the constraints:</p>
  
  <ol>
  <li>(CompanyID, emaildomain) should be unique in t;</li>
  <li>If an emaildomain of a company gets deleted (email domain could be
  any of emaildomain1, emaildomain2 or emaildomain3), the
  corresponding companyID and EmailDomain combination should get
  automatically deleted.</li>
  </ol>
  
  <p>For example, if a company Abc Inc. has 2 email domains abcinc.in and abc.org, and they plan to remove abcinc.in tomorrow, then I should have the corresponding entry in table t deleted.</p>
  
  <p>How do I get this effect with the help of primary and foreign keys ? I know that the delete on cascade has to be used, but I have no clue on how to bind foreign keys with multiple combinations of primary keys.</p>