title: How can I create a function in MySQL for add elements in a table?
body: <p>I would like to add elements in a table like this:</p>
  
  <pre><code>Codigo  Name   Lastname   Date    Sex    Salary
  1       name1  lastname1  random  random random
  2       name2  lastname2  random  random random
  3       name3  lastname3  random  random random
  4       name4  lastname4  random  random random
  </code></pre>
  
  <p>Date is a date random betweem years 2000 - 2015</p>
  
  <p>Sex is random boolean 1 or 0</p>
  
  <p>Salary is a random float between 500.00 and 5000.00</p>
  
  <p>is that possible? How can I do that? I don't know even how can I do the sentence while</p>
  
  <pre><code>CREATE OR REPLACE FUNCTION inserting(integer varying, character varying, character varying, date, boolean, float varying) RETURNS void
  AS $$
  begin
  insert into trabajador(codigo, name, lastname, date, sex, salary) values ($1,$2,$3,$4,$5,$6);
  end;
  $$
  LANGUAGE 'plpgsql';
  </code></pre>