A foreign key refers to another table by specifying the referencing and referenced columns. Both the referencing and referenced columns should map to each other. The mapping columns should be the same type and length. The referenced columns should be NOT NULL, but the referencing columns can be NULL. The referenced columns should be primary key or unique index.