title: Should one generate a unique id for each row in a database table that otherwise has no unique keys?
body: <p>I'm designing a MySQL database for a startup working with patient medical records. I have several tables that can have no unique keys: medical conditions, allergies, family history, etc. For example the <code>medications</code> table might have fields <code>patient_id</code>, <code>med_name</code>, <code>usage_dates</code>, <code>dosage</code>, <code>reason</code>, etc. The only guaranteed unique key is all of the fields together.</p>
  
  <p>A web application can easily retrieve this data for a given patient by selecting for <code>patient_id</code>, but unless it is possible to save pointers to rows inside a database with multiple users, it strikes me as a clumsy system for editing or deleting rows in this table. The DBMS would have to select for each field's value in order to find the correct row. From what (little) I know about databases, I imagine this could be inefficient in a large database.</p>
  
  <p>Would it be more efficient to create a new field with an ID number to function as a primary key in each of these tables, or is the DBMS way smarter than me and this is totally unnecessary?</p>