The foreign key is used to link one or more tables together. We can add a foreign key to a table in two ways:
?
Following is the syntax to ?create foreign key using CREATE TABLE OR ALTER TABLE statement:
?
[CONSTRAINT?constraint_name]????
??? FOREIGN?KEY?[foreign_key_name]?(col_name,?...)????
??? REFERENCES?parent_tbl_name?(col_name,...)???