Jump to content
Larry Ullman's Book Forums

Recommended Posts

Hi,

 

Is the an advantage to declaring foreign keys with the following syntax?

 


CREATE TABLE Orders
(
O_Id int NOT NULL,
OrderNo int NOT NULL,
P_Id int,
PRIMARY KEY (O_Id),
CONSTRAINT fk_PerOrders FOREIGN KEY (P_Id)
REFERENCES Persons(P_Id)
)

 

Many Thanks!

Link to comment
Share on other sites

Perhaps, depending upon the version of MySQL and the storage engine in use, neither of which do you mention.

 

MySQL 5.5.9

With A myISAM Storage engine.

 

Just saw the syntax at W3 Schools and was applying the question to the book examples.

 

As always Many Thanks!

Link to comment
Share on other sites

 Share

×
×
  • Create New...