title: Why I have this error in my trigger? MySQL
body: <p>I am creating a MySQL database, I want to create a trigger to change the amount of inventory available after a sale, but I get an error</p>
  <p>This is the code of the trigger</p>
  <pre><code>DROP TRIGGER IF EXISTS tr_inventario;
  CREATE TRIGGER tr_inventario AFTER INSERT ON factura FOR EACH ROW
      UPDATE producto INNER JOIN factura ON producto.IdProducto=factura.IdProducto
      SET producto.Invenatario=producto.Invenatario-factura.Cantidad 
      WHERE producto.IdProducto=factura.IdProducto;
  </code></pre>
  <p>This is the INSERT that i want to do</p>
  <pre><code>INSERT INTO factura(FechaVenta, NombreCliente, IdProducto, IdEmpleado, Cantidad) VALUES (now(), 'María Guadalupe',3, 2, 2);
  </code></pre>
  <p>And this is the error that I get</p>
  <pre><code>Error Code: 1048. Column 'Invenatario' cannot be null
  </code></pre>
  <p><a href="https://i.stack.imgur.com/Edita.png" rel="nofollow noreferrer">relational table</a></p>