title: mysql create a composite key with different data types
body: <p>So let's say I am trying to create a table in MYSQL that contains 3 columns, Id, Name and Price. How would I go about creating a composite key between the Id and Name, given that they are different data types? I have tried the following query but am presented with an error.</p>
  
  <pre><code>CREATE TABLE name_price (
  id int NOT NULL,
  name Varchar NOT NULL,
  price int,
  PRIMARY KEY (id, name)
  </code></pre>
  
  <p>);</p>
  
  <pre><code>You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'NOT NULL,
      price int,
      PRIMARY KEY (id, name)
  )' at line 3
  </code></pre>
  
  <p>Any help would be appreciated.</p>