title: Violation of PRIMARY KEY constraint. Cannot insert duplicate key in object - SQL Server - simple table
body: <p>I've had a look at some of the other answers to this kind of question, but as a beginner, they didn't quite make sense. </p>
  
  <p>Could someone please advise what I'd need to change in the queries below to prevent the error </p>
  
  <blockquote>
    <p>Violation of PRIMARY KEY constraint 'PK__Coding_I__C2232422662DE1EF'. Cannot insert duplicate key in object 'dbo.Coding_Interview'. The duplicate key value is (1)</p>
  </blockquote>
  
  <p>Thanks in advance. </p>
  
  <pre><code>create database Interview_Questions 
  
  CREATE TABLE Coding_Interview 
  (
      employee_id INT NOT NULL,
      first_name VARCHAR(30) NOT NULL,
      last_name VARCHAR(30) NOT NULL,
      gender VARCHAR(30) NOT NULL,
      position VARCHAR(30) NOT NULL,
      department_id INT NOT NULL,
      salary INT NOT NULL,
      PRIMARY KEY (department_id),
      UNIQUE (employee_id)
  );
  
  INSERT INTO Coding_Interview 
      (employee_id, first_name, last_name, gender, position, department_id, salary) 
  VALUES 
      (2002, 'Super', 'Man', 'M', 'Tester', 1, 75000 ),
      (2003, 'Jessica', 'Liyers', 'F', 'Architect', 1, 60000 ),
      (2004, 'Bonnie', 'Adams', 'F', 'Project Manager', 1, 80000), 
      (2005, 'James', 'Madison', 'M', 'Software Developer', 1, 55000),
      (2006, 'Michael', 'Greenback', 'M', 'Sales Assistant', 2, 85000), 
      (2007, 'Leslie', 'Peters', 'F', 'Sales Engineer', 2, 76000), 
      (2008, 'Max', 'Powers', 'M', 'Sales Representative', 2, 59000), 
      (2009, 'Stacy', 'Jacobs', 'F', 'Sales Manager', 2, 730000), 
      (2010, 'John', 'Henery', 'M', 'Sales Director', 2, 90000); 
  </code></pre>