Foreign key in SQL server

What is foreign key SQL SERVER constraint?

->A Foreign key is used to link two tables.
->Foreign key is a one table point to another table.
->Foreign key can accept multiple NULL values.
->We can have more than one Foreign key in a table.

How to create Foreign Key in SQL SERVER by Query?


 CREATE TABLE Employee(

    EmpId int NOT NULL PRIMARY KEY identity(1,1),
    EmpName Varchar(200),
    Department varchar(200),
    CompanyId int FOREIGN KEY REFERENCES Company (CId)
);

where:-
 Employee - Table name 2
Company - Table Name 1
CId - Table 1 Column name(Primary key)
CompanyId - table 2 Column name(Foreign Key)

How to set Foreign key in SQL SERVER For Existing Table Made Simple.

https://sqlsensationforu.blogspot.com/
Foreign Key
For More Sql Server Constraints