Is Caul the syntax for defining foreign key constraints in MySQL?

1

What in SQL SERVER is

constraint fk_name
     foreign key references tabla(campo)
    
asked by Gerardo Sorto 28.12.2018 в 20:29
source

1 answer

0

Declared

CONSTRAINT fk_tabla1_tabla2 FOREIGN KEY(columnaFK) REFERENCES tablaDestino(PKtabla);

You still need to use CONSTRAINT AND ONE name for the relationship

Afterwards, in the DELETE and the UPDATE you can determine which rules apply for the records that are linked between the main table and the dependent table

  • CASCADE
  • RESTRICT
  • SET NULL
  • NO ACTION
  • To indicate what happens with the dependent values

        
    answered by 28.12.2018 в 20:36