title: How to prevent Duplicate records from my table Insert ignore does not work here
body: <pre><code>mysql&gt; select * from emp;
  
      +-----+---------+------+------+------+
      | eno | ename   | dno  | mgr  | sal  |
      +-----+---------+------+------+------+
      |   1 | rama    |    1 | NULL | 2000 |
      |   2 | kri     |    1 |    1 | 3000 |
      |   4 | kri     |    1 |    2 | 3000 |
      |   5 | bu      |    1 |    2 | 2000 |
      |   6 | bu      |    1 |    1 | 2500 |
      |   7 | raa     |    2 | NULL | 2500 |
      |   8 | rrr     |    2 |    7 | 2500 |
      |   9 | sita    |    2 |    7 | 1500 |
      |  10 | dlksdgj |    2 |    2 | 2000 |
      |  11 | dlksdgj |    2 |    2 | 2000 |
      |  12 | dlksdgj |    2 |    2 | 2000 |
      |  13 | dlksdgj |    2 |    2 | 2000 |
      |  14 | dlksdgj |    2 |    2 | 2000 |
      +-----+---------+------+------+------+
  </code></pre>
  
  <p>Here is my table. I want to <em>eliminate</em> or <em>prevent</em> insertion of the duplicate records, as the <code>eno</code> field is <code>auto increment</code> total row never be duplicate, but the records are duplicates. How can I prevent inserting those duplicate records? </p>
  
  <p>I tried using <code>INSERT IGNORE AND ON DUPLICATE KEY UPDATE</code> (<em>I think I have not used them properly</em>).</p>
  
  <p>The way I used them is,</p>
  
  <pre><code>mysql&gt; insert into emp(ename,dno,mgr,sal) values('dlksdgj',2,2,2000);
  Query OK, 1 row affected (0.03 sec)
  
  mysql&gt; insert ignore into emp(ename,dno,mgr,sal) values('dlksdgj',2,2,2000);
  Query OK, 1 row affected (0.03 sec)
  
  mysql&gt; insert into emp(ename,dno,mgr,sal) values('dlksdgj',2,2,2000) ON DUPLICATE KEY UPDATE eno=eno;
  Query OK, 1 row affected (0.03 sec)
  mysql&gt; insert into emp(ename,dno,mgr,sal) values('dlksdgj',2,2,2000) ON DUPLICATE KEY UPDATE eno=eno;
  Query OK, 1 row affected (0.04 sec
  
  mysql&gt; desc emp;
  +-------+-------------+------+-----+---------+----------------+
  | Field | Type        | Null | Key | Default | Extra          |
  +-------+-------------+------+-----+---------+----------------+
  | eno   | int(11)     | NO   | PRI | NULL    | auto_increment |
  | ename | varchar(50) | YES  |     | NULL    |                |
  | dno   | int(11)     | YES  |     | NULL    |                |
  | mgr   | int(11)     | YES  | MUL | NULL    |                |
  | sal   | int(11)     | YES  |     | NULL    |                |
  +-------+-------------+------+-----+---------+----------------+
  </code></pre>