title: What is the difference between these two SQL queries?
body: <p>I've created table Address with this SQL query:</p>
  
  <pre><code>CREATE TABLE `address` (
    `id` bigint(20) NOT NULL AUTO_INCREMENT,
    `Street` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
    `Number` smallint(6) DEFAULT NULL,
    `other_id` bigint(20) NOT NULL,
    PRIMARY KEY (`id`),
    FOREIGN KEY (`other_id`) REFERENCES `other` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
  </code></pre>
  
  <p>But there's also this query:</p>
  
  <pre><code>CREATE TABLE `address` (
    `id` bigint(20) NOT NULL AUTO_INCREMENT,
    `Street` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
    `Number` smallint(6) DEFAULT NULL,
    `other_id` bigint(20) NOT NULL,
    PRIMARY KEY (`id`),
    KEY `other_id` (`other_id`),
    CONSTRAINT `adress_ibfk_1` FOREIGN KEY (`other_id`) REFERENCES `other` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci$$
  </code></pre>
  
  <p>and it seems that booth query create identical tables.</p>
  
  <p>So can anyone explain to me what does this line do:</p>
  
  <pre><code>KEY `other_id` (`other_id`),
  </code></pre>
  
  <p>and what is the difference between these two lines:</p>
  
  <pre><code>  FOREIGN KEY (`other_id`) REFERENCES `other` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
  and
    CONSTRAINT `adress_ibfk_1` FOREIGN KEY (`other_id`) REFERENCES `other` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
  </code></pre>
  
  <p>If the difference between last two lines is that latter gives name 'adress_ibfk_1' to foreign key ? If that's true - should I do it ? I mean, why should I name foreign keys ? Will I ever need their names ?</p>
  
  <p>Thanks ! :)</p>