title: How to specify primary key constraints when creating a Delta table
body: <p>I am using something like <a href="https://docs.databricks.com/_static/notebooks/read-csv-schema.html" rel="nofollow noreferrer">this</a> to create a dataframe. I then save it in a delta table using something like the following.</p>
  <pre><code>diamonds_with_schema.write.format(&quot;delta&quot;).saveAsTable(saveLocation)
  </code></pre>
  <p>My question is how can I make a column as primary key. Also, how to make a clustered primary key with two or more columns.</p>