title: generating alphanumeric employees id using trigger in mysql?
body: <p>hello friends i want to create a table employees </p>
  
  <pre><code>CREATE TABLE IF NOT EXISTS `employees` (
    `sno` int(11) NOT NULL AUTO_INCREMENT,
    `empcode` varchar(20) NOT NULL,
    `employeename` varchar(20) NOT NULL,
    `fathername` varchar(20) NOT NULL,
    `gender` varchar(6) NOT NULL,
    `dob` date NOT NULL,
    `contactno` varchar(12) NOT NULL,
    `address` varchar(100) NOT NULL,
    `city` varchar(20) NOT NULL,
    `state` varchar(20) NOT NULL,
    `branch` varchar(20) NOT NULL,
    `dateofjoining` date NOT NULL,
    PRIMARY KEY (`sno`),
    UNIQUE KEY `empcode` (`empcode`)
  ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
  </code></pre>
  
  <p>and i want to generate unique employee code when i insert a new record in employees table in a sequence  in employees table for example <code>CG000001</code> <code>CG000002</code>... so on using mysql <code>trigger</code> but not able to do my logic is fail very time please help me</p>