-
Erland Sommarskog 78,111 Reputation points MVP
2021-09-30T21:25:30.177+00:00 Some sample statements to get you started:
ALTER TABLE Department ADD CONSTRAINT pk_Department PRIMARY KEY(DeptId) ALTER TABLE Supervisor ADD CONSTRAINT fk_Supervisor_Department FOREIGN KEY (DeptID) REFERENCES (DeptID)
PRIMARY KEY VS FOREIGN KEYS SSMS (2019) EXPRESS

Kosovari_
81
Reputation points
I have three tables at SQL SERVER 2019 described below:
Table DEPARTMENTS : Columns DeptID , DeptName example FINANCE, IT .
Table EMPLOYEE : Columns : employeeID , SupervisorID .
Table SUPERVISOR : Columns : FirstName, LastName, SupervisorID, DeptID .
HOW TO EXECUTE ON QUERY in SQL SYNTAX OF PRIMARY KEYS AND FOREIGN KEYS FOR THESE THREE TABLES???
THANK YOU DEAREST FRIENDS . YOUNG KOSOVAR CITIZEN FROM KOSOVO ..
Accepted answer