title: Convert ER-Diagram to SQL
body: <p>I have trouble with converting an ER-Diagram into valid SQL code.</p>
  
  <p>Look at the following ER-Diagram</p>
  
  <p><a href="https://i.stack.imgur.com/Ovbjh.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Ovbjh.jpg" alt="enter image description here"></a></p>
  
  <p>How can I translate this ER-Diagram into SQL code? I Have trouble specifying  the relations. Would it make sense to create a third table just for the relations? </p>
  
  <pre><code>CREATE TABLE Faculty (
      Fac.-Nr INTEGER NOT NULL,
      PRIMARY KEY (  Fac.-Nr)
  );
  
  CREATE TABLE Prof (
      Name VARCHAR(255) NOT NULL,
      PRIMARY KEY (Name)
  );
  </code></pre>
  
  <p>I think that I have to work with constraints but I don't know how to properly convert the relations. </p>
  
  <p>I want to be able to insert the following information: </p>
  
  <p>|Name     |belongs to        | leads|</p>
  
  <p>|Smith |   Fac10        |      -|</p>
  
  <p>|Becker |  Fac10        |      Fac10|</p>
  
  <p>|John   |  Fac10          |    -|</p>
  
  <p>I'm very new to SQL so please be patient with me :) </p>
  
  <p>Help would be greatly appreciated!</p>