title: mysql prevent duplicate insert of more than one foreign keys
body: <p>I have 3 tables:</p>
  
  <p>The first is called 'users' and has 3 columns. id (PK), name and email.</p>
  
  <p>The second is called 'courses' and also has 3 columns: id (PK), name and code.</p>
  
  <p>The third is called 'user_courses' and is used to join the users and courses tables. It to has 3 columns: id (PK), userFK (fk to users.id) and courseFK (fk to courses.id) </p>
  
  <p>A user can only apply for a course once, however i can insert user with value '1' and course  with value '1' multiple times.</p>
  
  <p>My question is how do i prevent having a duplicate userFK, courseFK combination in the user_courses table?</p>