title: Using SQL to create tables and relationships from ERD
body: <p>I am working on an assignment for class where I have to take an ERD and create SQL statements to capture the relations.  I am asking if the SQL statements I have created capture these relationships.  In particular, I believe that "Dependent" is a weak entity and I do not know how to capture this relationship.  </p>
  
  <p>The ERD: <a href="https://imgur.com/mMLsMgS" rel="nofollow noreferrer">http://imgur.com/mMLsMgS</a></p>
  
  <p><img src="https://i.stack.imgur.com/wbJiC.png" alt="ERD"></p>
  
  <p>Here are my SQL statements:</p>
  
  <pre><code>CREATE TABLE Employees (
      ssn INTEGER, salary REAL, phone VARCHAR(24), PRIMARY KEY (ssn))
  
  CREATE TABLE Departments (
      dno INTEGER, dname VARCHAR(150), budget REAL, PRIMARY KEY (dno), 
      managerid INTEGER, FOREIGN KEY (managerid) REFERENCES Employees (ssn))
  
  CREATE TABLE Works_in (
      eid INTEGER, did INTEGER, PRIMARY KEY (ssn, did), FOREIGN KEY (ssn) 
      REFERENCES  Employees(eid), FOREIGN KEY (did) REFERENCES Dept (did))
  
  CREATE TABLE Child (
      parentssn INTEGER, name VARCHAR(50), age INTEGER, FOREIGN KEY (parentssn)   REFERENCES Employees (ssn))
  </code></pre>
  
  <p>If it is not acceptable to post homework questions, please feel free to delete this.</p>
  
  <p>I appreciate any and all help.</p>
  
  <p>Thank you!</p>