Add Foreign Key Rules : Foreign Key « Key « SQL / MySQL






Add Foreign Key Rules

      

ALTER TABLE tblname ADD FOREIGN KEY [idxname]
(column1) REFERENCES table2 (column2)

   
    
    
    
    
    
  








Related examples in the same category

1.Define foreign key
2.RESTRICT update and delete
3.Use a FOREIGN KEY constraint to define the foreign key
4.Add the foreign key by using the following
5.Reference foreign key
6.Two foreign keys
7.On delete set null
8.Cascade delete