I would like to know the difference between the execution of the Alter Table
clauses when entering the ADD CONSTRAINT
, for example by executing the following code:
ALTER TABLE Orders
ADD FOREIGN KEY (PersonID) REFERENCES Persons(PersonID);
What's the difference in using this code:
ALTER TABLE Orders
ADD CONSTRAINT FK_PersonOrder
FOREIGN KEY (PersonID) REFERENCES Persons(PersonID);
Are there improvements in performance, security, or any information that is important to know when it comes to database?
And taking advantage of the question,
exactly what does ADD CONSTRAINT
do? (I currently use MySQL
)