title: I have been assigned a project for currency exchange rate IN SQL . How to save exchange rates for currencies?
body: <p>I Have to create a table currencies</p>
  
  <pre><code>CREATE TABLE currencies (
         from_currency        CHAR(30) NOT NULL,
         ExchRate             REAL NOT NULL,
         to_currency          CHAR(30) NOT NULL,
         PRIMARY KEY (from_currency),
         FOREIGN KEY (to_currency) REFERENCES currencies(from_currency)
  )
  </code></pre>
  
  <p>I have to save exchange rate for 6 currencies: (inr,eur,cad,usd,gbp,cfp)
  But the problem is i can't store same values in first column
  i.e.
  I can save my currency rate as follow </p>
  
  <pre><code>from_curr      ER --&gt; to_curr 
  INR        --&gt; 60 --&gt;   USD
  USD        --&gt; 0  --&gt;   USD
  GBP        --&gt; 70 --&gt;   USD
  </code></pre>
  
  <p>e.t.c. for all the currencies but now the problem is while i try to store the currency for other er like</p>
  
  <pre><code>INR        --&gt; 1  --&gt;   USD
  or
  GBP        --&gt; 70 --&gt;   USD 
  </code></pre>
  
  <p>I get error duplicates values are not allowed ?
  How to solvve this problem ?</p>