title: Android SQL: Check if Record in Database Exists
body: <p>I am trying to query my database based on a specific id.</p>
  
  <pre><code>String sql = "SELECT * FROM mash WHERE recipe_id = '" + id + "'";
  Cursor data = database.rawQuery(sql, null);
  </code></pre>
  
  <p>If this is the first time the activity has been run, the table WILL exist along with the id column, but there will not be a record with the specific id. How can I check if that specific record exists and if it does not, add it? I have found lots of into regarding checking if a specific column exists, but nothing about checking if a specific record exists.</p>
  
  <p>So far I have tried getting the id column index and checking to see if it returns -1, but it actually is returning 1 for some reason. What can I use in an if statement to verify that the id column has not yet been created?</p>