title: How to fix unknown table for a table that is in the database?
body: <p>I am getting this error:</p>
  
  <blockquote>
    <p>Error 1051: Unknown Table 'employee'</p>
  </blockquote>
  
  <p>This is my code:</p>
  
  <pre><code> CREATE DEFINER=`u24290718`@`%` PROCEDURE `eval5_get_charter_details_by_pilot_date`(in fromdate DATE, todate DATE, pilotname VARCHAR(50))
  BEGIN
  
      if (pilotname = 'all')
      THEN
          SELECT aviaco.pilot.*, aviaco.employee.*
  
          FROM aviaco.pilot
  
          JOIN aviaco.employee AS emp on aviaco.pilot.EMP_NUM = aviaco.employee.EMP_NUM;
  
      ELSE
          SELECT aviaco.pilot.*, aviaco.employee.*
  
          FROM aviaco.pilot
  
          JOIN aviaco.employee AS emp on aviaco.pilot.EMP_NUM = aviaco.employee.EMP_NUM
  
          WHERE aviaco.pilot.PIL_MED_DATE = fromdate &amp; aviaco.pilot.PIL_PT135_DATE = todate;
      END IF;
  END
  </code></pre>
  
  <p>So the problem is that I keep getting unknown table <code>employee</code>. I am using a database on the university server and the employee table is there! I have no idea what I am doing wrong.</p>