title: How to make 2 columns work together to be unique?
body: <p>A customer, <code>cus_id</code> can own multiple houses. A house has a <code>house_num</code> by itself is not unique. However, together a <code>cus_id</code> and a <code>house_num</code> are unique. How can I make it so <code>cus_id</code> and <code>house_num</code> together are unique. So I can use <code>INSERT IGNORE INTO</code> and won't have to worry that I am going to insert a duplicate</p>
  <pre><code>CREATE TABLE house(
      house_id                    int
                                  NOT NULL
                                  AUTO_INCREMENT
                                  PRIMARY KEY,
  
      cus_id                      int
                                  NOT NULL,
                                  FOREIGN KEY (cus_id) REFERENCES customers (cus_id),
  
      house_num                   int
                                  NOT NULL
  );
  </code></pre>
  <p>Example of a table</p>
  <pre><code>+----------+--------+-----------+
  | house_id | cus_id | house_num |
  +----------+--------+-----------+
  |        1 |      3 |         4 |
  |        2 |      3 |         5 |
  |        3 |      8 |         4 |
  |        4 |      9 |         2 |
  +----------+--------+-----------+
  </code></pre>
  <p>However, this row  cannot exist as it would be a duplicate of <code>house_id</code> <code>2</code></p>
  <pre><code>+----------+--------+-----------+
  |        5 |      3 |         5 |
  +----------+--------+-----------+
  </code></pre>