title: What is the correct form of declaring variables in MySQL: declare vs @ vs set?
body: <p>I am trying to learn MySQL and after doing some database, I am having the following questions.</p>
  <p>When declaring a <em>variable</em> inside a procedure or in the function I can do it like this:</p>
  <ol>
  <li>using <code>@</code> sign, like this: <code>SET @varname = varcontent</code></li>
  <li>using <code>DECLARE</code> keyword, like this: <code>DECLARE varname vartype</code></li>
  <li>using directly <code>SET</code> without <code>DECLARE</code>, like this <code>SET varname = varcontent</code></li>
  </ol>
  <p>My doubts are:</p>
  <ul>
  <li>what type of syntax is correct, using <code>DECLARE</code>, <code>@</code> or <code>SET</code>?</li>
  <li>what would be the correct form of doing it?</li>
  </ul>
  <p>Also, I would like if you could recommend some good practices with MySQL.</p>