title: Function in mysql
body: <p>I am have created function in mysql.</p>
  
  <p>This is code of my function</p>
  
  <pre><code> DROP FUNCTION `star`//
  
  CREATE DEFINER=`root`@`localhost` FUNCTION `star`(
  num INT
  
  ) RETURNS int(11)
  DETERMINISTIC
   BEGIN
  
                  IF(num&gt;=0 &amp;&amp; num&lt;20)
                  THEN
                  RETURN 1;
                  ELSEIF(num&gt;=20 &amp;&amp; num&lt;40)
                  THEN
                  RETURN 2;
                  ELSEIF(num&gt;=40 &amp;&amp; num&lt;60)
                  THEN
                  RETURN 3;
                  ELSEIF(num&gt;=60 &amp;&amp; num&lt;80)
                  THEN
                  RETURN 4;
                  ELSEIF(num&gt;=80 &amp;&amp; num&lt;=100)
                  THEN
                  RETURN 5;
                  END IF;
      END
  </code></pre>
  
  <p>I have forgotten how did i made this function in my database. Now i want to create same function into another database.</p>
  
  <p>For this i just copy above code and paste that in sql. and press Go. But it creates error.
  Please tell me what mistake i have done. </p>