title: delete a record and its FOREIGN key via a sql query
body: <p>I want delete an record by 'url' key match  in this table:   </p>
  
  <pre><code>$sql = "CREATE TABLE IF NOT EXISTS Articls 
          (
              id INT(10) UNSIGNED AUTO_INCREMENT PRIMARY KEY,     
              alias INT(10) UNSIGNED NOT NULL,                                 
              title VARCHAR(254) COLLATE utf8_persian_ci NOT NULL,        
              url VARCHAR(2083) COLLATE utf8_persian_ci NOT NULL,                      
              UNIQUE (alias),
              UNIQUE (title),
          )   DEFAULT COLLATE utf8_persian_ci";
  </code></pre>
  
  <p>but After that I want delete all relative tags name in 'Tags' table too!</p>
  
  <pre><code> $sql = "CREATE TABLE IF NOT EXISTS Tags (
              id INT(10) UNSIGNED AUTO_INCREMENT PRIMARY KEY,  
              alias INT(10) UNSIGNED NOT NULL,    
              name VARCHAR(256) COLLATE utf8_persian_ci NOT NULL, 
              state INT(2) NOT NULL DEFAULT 1, 
              created INT(11) NOT NULL,
              FOREIGN KEY (alias) REFERENCES Articls (alias)      
          ) DEFAULT COLLATE utf8_persian_ci";
  </code></pre>
  
  <p>Can I do it just with mysql query?</p>
  
  <p>I do it with some php/mysql now:</p>
  
  <p>1-get  alias where url = 'my url' in Articls.</p>
  
  <p>2- delete all record in Tags table.</p>
  
  <ol start="3">
  <li>delete target record (where url = 'my url') in 'Articls' table. </li>
  </ol>