title: SQL command to perform division
body: <p>I have the following tables.</p>
  
  <pre><code>STUDENT(ID, FIRST_NAME, LAST_NAME, MAJOR)
  INSTRUCTOR(ID, FIRST_NAME, LAST_NAME, DEPARTMENT, SALARY)
  COURSE(ID, COURSE_NAME, DESCRIPTION)
  COURSE_OFFERING(ID, COURSE_ID, INSTRUCTOR_ID,  SEMESTER)
  GRADE(STUDENT_ID, COURSE_OFFERING_ID,  GRADE)
  </code></pre>
  
  <p>Find the names of all students who have taken every course taught by Einstein.</p>
  
  <p>The sql command which I used is </p>
  
  <pre><code>select STUDENT_ID 
  from grade where not exists
     (select grade.COURSE_OFFERING_ID from grade 
      where grade.COURSE_OFFERING_ID not in 
             (
               select course_offering.ID 
               from instructor join course_offering 
               where instructor.ID = course_offering.INSTRUCTOR_ID 
               and instructor.FIRST_NAME = 'Einstein')
             );
  </code></pre>
  
  <p>Please explain where I am making a mistake or is there any other way to perform division in SQL?</p>