In SQL we can create the primary key
Ex: create table student
(
stid int primary key identity(1,1),
stname varchar(50)
)
In SQL we can also create the foreign key using SQL query
Ex: create table account
(
staccid int primary key identity(1,1),
stid int references student(stid)
)
In SQL we can delete the primary key constraint using the alter command
Ex: ALTER TABLE Persons
DROP CONSTRAINT pkPersonID
Same has been done to remove the foreign key reference
Ex: ALTER TABLE Orders
DROP CONSTRAINT fkPerOrders
0 Comment(s)