title: Oracle (ORA-02270) : no matching unique or primary key for this column-list error
body: <p>I have two tables, <code>Table JOB</code> and <code>Table USER</code>, here is the structure</p>
  
  <pre><code> CREATE TABLE JOB
   (
     ID       NUMBER NOT NULL ,
     USERID   NUMBER,
     CONSTRAINT B_PK PRIMARY KEY ( ID ) ENABLE
   );
  
   CREATE TABLE USER
   (
     ID       NUMBER NOT NULL ,
     CONSTRAINT U_PK PRIMARY KEY ( ID ) ENABLE
   );
  </code></pre>
  
  <p>Now, i want to add foreign key constraint to <code>JOB</code> referencing to <code>USER</code> table, as </p>
  
  <pre><code>Alter Table JOB ADD CONSTRAINT FK_USERID FOREIGN KEY(USERID) REFERENCES USER(ID);
  </code></pre>
  
  <p>this throws <code>Oracle (ORA-02270) : no matching unique or primary key for this column-list error</code>, doing some investigation it appears that we need to have either <code>unique key or primary key</code> constraint on <code>USERID</code> but I cannot have that as one <code>USERID</code> can have multiple <code>JOBS</code> associated with him, any thoughts or suggestions on how to fix this issue?</p>
  
  <p>Researched <a href="http://oraclequirks.blogspot.com/2007/09/ora-02270-no-matching-unique-or-primary.html" rel="noreferrer">ORA-02270</a> and <a href="https://stackoverflow.com/q/7521817/164299">SO related question</a></p>