title: How to create a composite Primary Key on a Table
body: <p>I have created a  table, i have inserted some data as well. I have 1 primary key on the table which is incremented by auto-generated number. I have <code>user_id</code> and <code>semester_course_id</code> columns both are <code>foreign_keys</code>. I want to add composite key on 2 Columns <code>user_id</code> and <code>semester_course_id</code> .</p>
  
  <p>So that 1 Student_id can register to 1 Course only. <code>Semester_Course_id</code> and <code>student_id</code> will  repeat in the table, but together they have to appear one time only.</p>
  
  <p>Kindly tell me how to add composite primary key.</p>
  
  <p><img src="https://i.stack.imgur.com/ydFjz.png" alt="enter image description here">
  <img src="https://i.stack.imgur.com/WApOd.png" alt="enter image description here"></p>
  
  <p>Thanks</p>