title: SQL, How to delete rows from related tables using a query?
body: <p>I have the following tables</p>
  
  <pre><code>    vehicle (veh_num(PK), veh_desc)
      log (log_num(PK), veh_num(FK), log_date, log_complaint)
      log_line (log_num(PK,FK), logline_num(PK), emp_id(FK), logline_date,logline_action)
      part (part_code(PK), logline_num(FK), log_num(FK), part_desc)
      signout (signout_num(PK), part_code(FK), emp_id(FK), log_num(FK), signout_date)
  </code></pre>
  
  <p>I want to run a query which will delete all the records in the vehicle table with for instance, veh_num = "EK458" and also delete rows which are related to the veh_num in the other tables. </p>
  
  <p>I have started with the following query, </p>
  
  <pre><code>    DELETE FROM signout WHERE EXISTS
      (select * from vehicle,log,log_line,part
      where 
      vehicle.veh_num = 'EK458'  AND
      vehicle.veh_num = log.veh_num AND
      log.log_num = log_line.log_num AND
      log_line.log_num = part.log_num AND 
      part.part_code = signout.part_code);
  </code></pre>
  
  <p>This query deletes all the associated values of veh_num = "EK458" in the signout table, however, I want a query which will delete the rows from the all the tables which are related to veh_num.
  Thanks in advance</p>