title: Query to change my table to foreign key using MySQL
body: <p>I am in need of a help to build a query that references the primary key of my <code>cadastro_cliente</code> table. I already did with the date, but with the <code>cadastro_cliente</code>-> <code>meter</code> is not working.</p>
  
  <p><a href="https://i.stack.imgur.com/7L28i.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/7L28i.png" alt="enter image description here"></a></p>
  
  <p>The query I tried to use is:</p>
  
  <pre><code>ALTER TABLE medidor
  ADD CONSTRAINT Fk_cadastro_cliente
  Foreign KEY (Cad_geral_cli_codigo)
  References Cadastro_cliente (Cad_geral_cli_codigo);
  </code></pre>