Effect of the primary key on the other tables

Asked By 0 points N/A Posted on -
qa-featured

In database created with SQL language,when the primary key is deleted in one table;

every table referred to this key will be deleted automatically?

SHARE
Answered By 0 points N/A #97461

Effect of the primary key on the other tables

qa-featured
Primary key is an attribute in one table that has been referenced in other tables.  A concept of data integrity in database is important in any database system that “A primary key attribute value cannot be edited or deleted until there are referenced values of the primary data else where in any other table”. So the main answer to it is you cannot do that.
 
For this if you want to delete the key F01, then delete/change the row(s) with FO1 in the referenced table and then you have to delete/change the row having the primary attribute value F01. In other words, delete the foreign key first then the primary key.
 
Thanks

Related Questions